Skip to content

Instantly share code, notes, and snippets.

@ety001
Last active July 8, 2016 09:11
Show Gist options
  • Select an option

  • Save ety001/9ae81ca8d46b95b53d86f478c01115b8 to your computer and use it in GitHub Desktop.

Select an option

Save ety001/9ae81ca8d46b95b53d86f478c01115b8 to your computer and use it in GitHub Desktop.
90-dnspod.sh
#!/bin/sh
[ "$ACTION" = ifup ] || exit 0
[ "$INTERFACE" = wan ] || exit 0
ipaddr=$(ifconfig pppoe-wan | grep inet | awk '{print $2}' | cut -c 6-)
logger $ipaddr
param='login_token=TOKEN&format=json&domain_id=29668&record_id=192014&sub_domain=sip&value='${ipaddr}'&record_type=A&record_line=默认'
curl -X POST https://dnsapi.cn/Record.Modify -d $param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment