#!/bin/sh ROOT_UID=0 # Only users with $UID 0 have root privileges. E_NOTROOT=67 # Non-root exit error. # Run as root, of course. if [ "$UID" -ne "$ROOT_UID" ]; then echo "Must be root to run this script." exit $E_NOTROOT fi nslookup=`nslookup \`uname -n\` | grep Address: | tail -1 | awk '{print $2}'` #echo nslookup=$nslookup checkip=`curl http://checkip.dyndns.org | awk '{print $6}' ` #echo checkip=$checkip checkipLen=`echo ${#checkip}` #echo checkipLen=$checkipLen checkip=`echo ${checkip:0:($checkipLen -15)}` #echo new checkip=$checkip if [ "$nslookup" != "$checkip" ]; then runcurl="curl http://username:password@members.dyndns.org/nic/update?system=dyndns&hostname=site1.dyndns.org,site2.dyndns.org&myip=$checkip&wildcard=ON" #echo runcurl=$runcurl `echo $runcurl` echo -e "Running runlikeddclient on `hostname -s`" | (cat <