80后的细娃儿

ddns_update dnspod

动态监控公网ip地址,有变化就更新到dnspod

#!/bin/bash
new_ip=curl ip.xiwaer.com
old_ip=cat /root/dnspodip
if [ ! $new_ip = $old_ip ]
then
echo $new_ip > /root/dnspodip
echo date -u “ip has changed, the new ip is $new_ip !!! ” > /root/dnspod_log
sh /root/dnspod.sh
fi

dnspod shell脚本内容

dnspod

 

循环云新代码,   cs为自定义命令

while : ;do cs; sleep 120; done;

点赞