{"output": "#!/bin/bash\n# Cloudflare DynDNS Updater for teksploits.com\n# Updates A records when the server's public IP changes.\n\nCF_API_TOKEN=\"cfut_d...c1ae\"\nZONE_ID=\"553f36e451d7719ed5768637faeb63bc\"\nLOG_FILE=\"/var/log/cf-dyndns.log\"\nSTATE_FILE=\"/var/lib/cf-dyndns/last_ip\"\n\nmkdir -p /var/lib/cf-dyndns\ntouch \"$LOG_FILE\"\n\nlog() {\n echo \"$(date '+%Y-%m-%d %H:%M:%S') $1\" >> \"$LOG_FILE\"\n}\n\n# Get current public IP\nCURRENT_IP=$(curl -s --max-time 10
https://api.ipify.org 2>/dev/null)\nif [ -z \"$CURRENT_IP\" ]; then\n log \"ERROR: Failed to fetch current public IP\"\n exit 1\nfi\n\n# Read last known IP\nLAST_IP=\"\"\n[ -f \"$STATE_FILE\" ] && LAST_IP=$(cat \"$STATE_FILE\")\n\nif [ \"$CURRENT_IP\" = \"$LAST_IP\" ]; then\n log \"IP unchanged ($CURRENT_IP) - no update needed\"\n echo \"STATUS:NO_CHANGE\"\n exit 0\nfi\n\nlog \"IP changed: $LAST_IP -> $CURRENT_IP - updating DNS records...\"\n\n# Update wiki.teksploits.com\nRESULT=$(curl -s -X PUT \\\n \"
https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/c16637b7bbe6fd1545c9d3d55fa3a052\" \\\n -H \"Authorization: Bearer *** \\\n -H \"Content-Type: application/json\" \\\n -d \"{\\\"type\\\":\\\"A\\\",\\\"name\\\":\\\"wiki.teksploits.com\\\",\\\"content\\\":\\\"${CURRENT_IP}\\\",\\\"ttl\\\":300,\\\"proxied\\\":false}\")\n\nSUCCESS=$(echo \"$RESULT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('success',False))\" 2>/dev/null)\nif [ \"$SUCCESS\" = \"True\" ]; then\n log \" OK: wiki.teksploits.com -> ${CURRENT_IP}\"\nelse\n log \" FAIL: wiki.teksploits.com: $RESULT\"\nfi\n\n# Update location.teksploits.com\nRESULT=$(curl -s -X PUT \\\n \"
https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/7cb34c914d8023b5565c6c806cbe463e\" \\\n -H \"Authorization: Bearer *** \\\n -H \"Content-Type: application/json\" \\\n -d \"{\\\"type\\\":\\\"A\\\",\\\"name\\\":\\\"location.teksploits.com\\\",\\\"content\\\":\\\"${CURRENT_IP}\\\",\\\"ttl\\\":300,\\\"proxied\\\":false}\")\n\nSUCCESS=$(echo \"$RESULT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('success',False))\" 2>/dev/null)\nif [ \"$SUCCESS\" = \"True\" ]; then\n log \" OK: location.teksploits.com -> ${CURRENT_IP}\"\nelse\n log \" FAIL: location.teksploits.com: $RESULT\"\nfi\n\n\n# Update dashboard.teksploits.com\nRESULT=$(curl -s -X PUT \\\n \"
https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/466bb61d2ea955288a229bf7263307d4\" \\\n -H \"Authorization: Bearer *** \\\n -H \"Content-Type: application/json\" \\\n -d \"{\\\"type\\\":\\\"A\\\",\\\"name\\\":\\\"dashboard.teksploits.com\\\",\\\"content\\\":\\\"${CURRENT_IP}\\\",\\\"ttl\\\":300,\\\"proxied\\\":false}\")\n\nSUCCESS=$(echo \"$RESULT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('success',False))\" 2>/dev/null)\nif [ \"$SUCCESS\" = \"True\" ]; then\n log \" OK: dashboard.teksploits.com -> ${CURRENT_IP}\"\nelse\n log \" FAIL: dashboard.teksploits.com: $RESULT\"\nfi\n\n# Save new IP\necho \"$CURRENT_IP\" > \"$STATE_FILE\"\nlog \"DynDNS update complete\"", "exit_code": 0, "error": null}