curl -k -A 'xddns' $API_url/Record.Modify -d $shared_data"$extra_data"
done
}
removeRecord(){
read -p "list the subdomains to be deleted " subdomain
sub_domains="$subdomain"
for sub_domain in $sub_domains;do
record_id=`getRecordId`
local extra_data="&domain_id=$domain_id&record_id=$record_id"
curl -k -A 'xddns' $API_url/Record.Remove -d $shared_data"$extra_data"
done
exit
}
checkip() {
oldip=$pub_ip_addr
newip=$(curl -s http://checkip.dyndns.com | sed -n 's/.*: \([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/p')
if [ "$newip" != "$oldip" ];then
oldip="$newip"
return 8
else
return 3
fi
}
if [ $# -ne 2 ];then
echo "usage:$PROGRAM |-c create record|-r remove records|-C create new domain|-m modify record | -bc create a batch of records DOMAIN [eg.example.com]"