[25d26c]: / scripts / S99dyndns  Maximize  Restore  History

Download this file

45 lines (37 with data), 1.5 kB

#!/bin/sh
cd /mnt/flash/root/bin

INADYN=/mnt/flash/root/bin/inadyn-advanced

ddenabled=$(/mnt/flash/root/bin/checkconfig -b dyndns.enabled)
ddalias=$(/mnt/flash/root/bin/checkconfig -s dyndns.alias)
ddhash=$(/mnt/flash/root/bin/checkconfig -s dyndns.hash)
ddusername=$(/mnt/flash/root/bin/checkconfig -s dyndns.username)
ddpassword=$(/mnt/flash/root/bin/checkconfig -s dyndns.password)
ddservice=$(/mnt/flash/root/bin/checkconfig -s dyndns.service)
ddupdateperiod=$(/mnt/flash/root/bin/checkconfig -i dyndns.updateperiod)
ddcustomservername=$(/mnt/flash/root/bin/checkconfig -s dyndns.customservername)
ddcustomserverurl=$(/mnt/flash/root/bin/checkconfig -s dyndns.customserverurl)



if [ "$ddenabled" == "TRUE" ]; then
   ddarguments="--alias $ddalias"
   if [ "$ddhash" != "" ]; then
      ddarguments="$ddarguments,$ddhash"
   fi
   if [ "$ddusername" != "" ]; then
      ddarguments="$ddarguments -u $ddusername"
   fi
   if [ "$ddpassword" != "" ]; then
      ddarguments="$ddarguments -p $ddpassword"
   fi
   if [ "$ddservice" != "" ]; then
      ddarguments="$ddarguments --dyndns_system $ddservice"
   fi
   if [ "$ddupdateperiod" != "" ]; then
      ddarguments="$ddarguments --update_period $ddupdateperiod"
   fi
   if [ "$ddcustomservername" != "" ]; then
      ddarguments="$ddarguments --dyndns_server_name $ddcustomservername"
   fi
   if [ "$ddcustomserverurl" != "" ]; then
      ddarguments="$ddarguments --dyndns_server_url $ddcustomserverurl"
   fi

   $INADYN $ddarguments &
fi