I have a dynamic DNS script as follows:

#!/bin/bash
curl -kL# "http://example.com/updatedns.php"
echo $? >> /var/log/ddns

...saved to /usr/local/bin/ddns. Obviously the URL above isn't the one I actually use, but the URL is meant to set the A record of my domain to the IP of the machine that requested it. I have confirmed it has been chmodded and runs from the command line, however, Upstart, which has been set up with the following script:

start on network started
exec /usr/local/bin/ddns

...doesn't execute it when the network starts (which I'm assuming is when the machine is booted or I connect the network cord).

I googled start on network started and found some results saying that this stanza doesn't actually get started properly, but still gets triggered, however I'm not sure if that's related or not. Am I doing something wrong? I'm running Ubuntu Server 11.10.

link|improve this question
feedback

3 Answers

up vote 2 down vote accepted
grep 'emit' /etc/network/if-up.d/upstart -a5

Suggests you should probably use start on net-device-up.

If you have more than one det device (and all don't have gateways), you can add an argument on the end like so:

start on net-device-up IFACE=eth0
link|improve this answer
Thanks for your answer. I tried this and it works, though I'm unsure if it'll fire when my external IP changes. I'll be able to work that out when it does tomorrow. – thekirbylover Jan 6 at 16:45
feedback

The traditional (pre-upstart, and still working) method was to place scripts in /etc/network/if-up.d directory.

Note that Ubuntu has pre-packaged DynDNS updating scripts: I can see dyndns, ddclient, inadyn, ez-ipupdate, and ipcheck packaged in Ubuntu. All should work :)

link|improve this answer
feedback

root@HKHHKGSCP1MS003:/home/ms003# ./audit_linux.sh : No such file or directoryd: /tmp : Unknown hostcs.com Not connected. ?Invalid command Not connected. ?Invalid command root@HKHHKGSCP1MS003:/home/ms003#

why its not running properly. here is the script.

HOST=hostname dmidecode > /tmp/$HOST lspci -v >> /tmp/$HOST cd /tmp ftp -n << EOF open fsserv.sscs.com user tsys_upload_audit T@ys-Upl04D binary put $HOST quit EOF root@HKHHKGSCP1MS003:/home/ms003#

link|improve this answer
1  
This is unrelated to my question; you should click “Ask Question” at the top of the page and ask there. – thekirbylover Apr 20 at 16:17
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.