Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)

Paste

Pasted as Bash by grupopalevan ( 7 years ago )
#!/bin/sh

hosts=( 'your.host.tld' )
user='username'
pass_enc='password using base64'
lastipfile='/tmp/lastip'
pass=`echo $pass_enc | base64 -d`
myip=`dig a myip.opendns.com @resolver1.opendns.com +short`
lastip=`cat $lastipfile`

if [ "$myip" != "$lastip" ]; then
  for host in ${hosts[@]};
    do
      URL="https://dyndns.dns-stock.com/?hostname=$host&username;=$user&password;=$pass&myip;=$myip"
      wget -O /dev/null --quiet --no-check-certificate $URL
      echo $myip > $lastipfile
      touch $lastipfile
  done
else
  echo "IP did not change!" > /dev/null
fi

 

Revise this Paste

Parent: 101339
Your Name: Code Language: