lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # $Id: ddns.sh,v 1.1 2007-09-24 09:34:52 winfred Exp $ |
| 4 | # |
| 5 | # usage: ddns.sh |
| 6 | # |
| 7 | path_sh=`nv get path_sh` |
| 8 | . $path_sh/global.sh |
| 9 | echo "Info: ddns.sh start" >> $test_log |
| 10 | |
| 11 | srv=`nv get DDNSProvider` |
| 12 | ddns=`nv get DDNS` |
| 13 | ddns_hash=`nv get DDNS_Hash_Value` |
| 14 | u=`nv get DDNSAccount` |
| 15 | pw=`nv get DDNSPassword` |
| 16 | ddns_enable=`nv get DDNS_Enable` |
| 17 | |
| 18 | killall -q inadyn |
| 19 | rm -rf $path_conf/inadyn.status |
| 20 | |
| 21 | if [ "x$ddns_enable" = "x0" ]; then |
| 22 | exit 0 |
| 23 | fi |
| 24 | if [ "x$srv" = "x" -o "x$srv" = "xnone" ]; then |
| 25 | exit 0 |
| 26 | fi |
| 27 | if [ "x$ddns" = "x" -o "x$u" = "x" -o "x$pw" = "x" ]; then |
| 28 | exit 0 |
| 29 | fi |
| 30 | |
| 31 | # debug |
| 32 | echo "srv=$srv" |
| 33 | echo "ddns=$ddns" |
| 34 | echo "ddns_hash=$ddns_hash" |
| 35 | echo "u=$u" |
| 36 | echo "pw=$pw" |
| 37 | |
| 38 | |
| 39 | if [ "x$srv" = "xdyndns.org" ]; then |
| 40 | inadyn -u $u -p $pw -a $ddns --dyndns_system dyndns@$srv & |
| 41 | elif [ "x$srv" = "xfreedns.afraid.org" ]; then |
| 42 | inadyn -u $u -p $pw -a $ddns,$ddns_hash --dyndns_system default@$srv & |
| 43 | elif [ "x$srv" = "xzoneedit.com" ]; then |
| 44 | inadyn -u $u -p $pw -a $ddns --dyndns_system default@$srv & |
| 45 | elif [ "x$srv" = "xno-ip.com" ]; then |
| 46 | inadyn -u $u -p $pw -a $ddns --dyndns_system default@$srv & |
| 47 | else |
| 48 | inadyn -u $u -p $pw -a $ddns --dyndns_system default@$srv & |
| 49 | echo "unknown DDNS provider: $srv" |
| 50 | fi |
| 51 | |