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