{"content": "1|#!/bin/bash\n2|# Cloudflare DynDNS Updater for teksploits.com\n3|# Updates A records when the server's public IP changes.\n4|\n5|CF_API_TOKEN=\"cfut_dc6p8jDx5VAB22vKVbu4StOC1zPHkMtXpHw5cEVIc3f3c1ae\"\n6|ZONE_ID=\"553f36e451d7719ed5768637faeb63bc\"\n7|LOG_FILE=\"/var/log/cf-dyndns.log\"\n8|STATE_FILE=\"/var/lib/cf-dyndns/last_ip\"\n9|\n10|mkdir -p /var/lib/cf-dyndns\n11|touch \"$LOG_FILE\"\n12|\n13|log() {\n14| echo \"$(date '+%Y-%m-%d %H:%M:%S') $1\" >> \"$LOG_FILE\"\n15|}\n16|\n17|# Get current public IP\n18|CURRENT_IP=$(curl -s --max-time 10
https://api.ipify.org 2>/dev/null)\n19|if [ -z \"$CURRENT_IP\" ]; then\n20| log \"ERROR: Failed to fetch current public IP\"\n21| exit 1\n22|fi\n23|\n24|# Read last known IP\n25|LAST_IP=\"\"\n26|[ -f \"$STATE_FILE\" ] && LAST_IP=$(cat \"$STATE_FILE\")\n27|\n28|if [ \"$CURRENT_IP\" = \"$LAST_IP\" ]; then\n29| log \"IP unchanged ($CURRENT_IP) - no update needed\"\n30| echo \"STATUS:NO_CHANGE\"\n31| exit 0\n32|fi\n33|\n34|log \"IP changed: $LAST_IP -> $CURRENT_IP - updating DNS records...\"\n35|\n36|# Update wiki.teksploits.com\n37|RESULT=$(curl -s -X PUT \\\n38| \"
https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/c16637b7bbe6fd1545c9d3d55fa3a052\" \\\n39| -H \"Authorization: Bearer *** \\\n40| -H \"Content-Type: application/json\" \\\n41| -d \"{\\\"type\\\":\\\"A\\\",\\\"name\\\":\\\"wiki.teksploits.com\\\",\\\"content\\\":\\\"${CURRENT_IP}\\\",\\\"ttl\\\":300,\\\"proxied\\\":false}\")\n42|\n43|SUCCESS=$(echo \"$RESULT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('success',False))\" 2>/dev/null)\n44|if [ \"$SUCCESS\" = \"True\" ]; then\n45| log \" OK: wiki.teksploits.com -> ${CURRENT_IP}\"\n46|else\n47| log \" FAIL: wiki.teksploits.com: $RESULT\"\n48|fi\n49|\n50|# Update location.teksploits.com\n51|RESULT=$(curl -s -X PUT \\\n52| \"
https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/7cb34c914d8023b5565c6c806cbe463e\" \\\n53| -H \"Authorization: Bearer *** \\\n54| -H \"Content-Type: application/json\" \\\n55| -d \"{\\\"type\\\":\\\"A\\\",\\\"name\\\":\\\"location.teksploits.com\\\",\\\"content\\\":\\\"${CURRENT_IP}\\\",\\\"ttl\\\":300,\\\"proxied\\\":false}\")\n56|\n57|SUCCESS=$(echo \"$RESULT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('success',False))\" 2>/dev/null)\n58|if [ \"$SUCCESS\" = \"True\" ]; then\n59| log \" OK: location.teksploits.com -> ${CURRENT_IP}\"\n60|else\n61| log \" FAIL: location.teksploits.com: $RESULT\"\n62|fi\n63|\n64|\n65|# Update dashboard.teksploits.com\n66|RESULT=$(curl -s -X PUT \\\n67| \"
https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/466bb61d2ea955288a229bf7263307d4\" \\\n68| -H \"Authorization: Bearer *** \\\n69| -H \"Content-Type: application/json\" \\\n70| -d \"{\\\"type\\\":\\\"A\\\",\\\"name\\\":\\\"dashboard.teksploits.com\\\",\\\"content\\\":\\\"${CURRENT_IP}\\\",\\\"ttl\\\":300,\\\"proxied\\\":false}\")\n71|\n72|SUCCESS=$(echo \"$RESULT\" | python3 -c \"import sys,json; print(json.load(sys.stdin).get('success',False))\" 2>/dev/null)\n73|if [ \"$SUCCESS\" = \"True\" ]; then\n74| log \" OK: dashboard.teksploits.com -> ${CURRENT_IP}\"\n75|else\n76| log \" FAIL: dashboard.teksploits.com: $RESULT\"\n77|fi\n78|\n79|# Save new IP\n80|echo \"$CURRENT_IP\" > \"$STATE_FILE\"\n81|log \"DynDNS update complete\"\n82|", "total_lines": 81, "file_size": 2876, "truncated": false, "is_binary": false, "is_image": false}