ChrisRChamberlain
Programmer
Hi all
Have reinstalled Ubuntu Server 11.04 and have the following crontab command
The file /var/data/bin/zoneedit.sh appears to run in the command window.
The content of zoneedit.sh is
As far as I know, the code is exactly as was before reinstalling. The file /var/data/bin/ipaddress exists and even if IP address in the file is the current external IP address it still fails, so the error is not in the second half of the program.
The ownership of the folder/files etc is mine.
The error message emailed is
TIA
PDFcommander.com
motrac.co.uk
Have reinstalled Ubuntu Server 11.04 and have the following crontab command
Code:
MAILTO me@mydomain.com
*/5 * * * * /var/data/bin/zoneedit.sh
The content of zoneedit.sh is
Code:
#!/bin/bash
ipfile='/var/data/bin/ipaddress'
[[ -f "$ipfile" ]] && ipold="$(< "$ipfile" )"
ipnew="$( wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //;s/<.*$//' )"
if [[ "$ipold" != "$ipnew" ]]; then
echo "$ipnew" > "$ipfile"
/usr/sbin/ssmtp me@mydomain.com < /var/[URL unfurl="true"]www/ipaddress[/URL]
wget -O - --http-user=Me --http-passwd=Password '[URL unfurl="true"]http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mydomain.com'[/URL]
wget -O - --http-user=Me --http-passwd=Password '[URL unfurl="true"]http://dynamic.zoneedit.com/auth/dynamic.html?host=mydomain.com'[/URL]
fi
The ownership of the folder/files etc is mine.
The error message emailed is
Code:
/bin/sh: /var/data/bin/zoneedit.sh: not found
TIA
FAQ184-2483
Chris PDFcommander.com
motrac.co.uk