Skip to content

Instantly share code, notes, and snippets.

@lialosiu
Created November 17, 2016 09:37
Show Gist options
  • Save lialosiu/deaa969f7b5a28b8f0151fa4bd3e6190 to your computer and use it in GitHub Desktop.
Save lialosiu/deaa969f7b5a28b8f0151fa4bd3e6190 to your computer and use it in GitHub Desktop.
dnspod ddns php更新脚本
<?php
$id = isset($_GET['id']) ? $_GET['id'] : null;
$token = isset($_GET['token']) ? $_GET['token'] : null;
$domain = isset($_GET['domain']) ? $_GET['domain'] : null;
$host = isset($_GET['host']) ? $_GET['host'] : null;
$record_id = isset($_GET['record_id']) ? $_GET['record_id'] : null;
$ip = isset($_GET['ip']) ? $_GET['ip'] : null;
$rsp = exec("/opt/bin/curl -X POST https://dnsapi.cn/Record.Ddns -d 'login_token=$id,$token&format=json&domain=$domain&sub_domain=$host&record_id=$record_id&record_line_id=0&value=$ip'");
syslog(LOG_INFO, $rsp);
echo $rsp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment