Hi
I connect to my remote network using DDNS over the Internet, SSH and Putty. I have a Tiny Core box and a broadband router on that network. Everything works well.
I would like to pause the boot process of my remote Tiny Core box which boots at the same time as the broadband router, until the latter is fully up so I can get it's public IP address which is emailed to me by the Tiny Core box.
Here are the relevant lines in my bootlocal.sh:
.
.
/opt/eth0.sh &
.
until /usr/bin/nc -z 192.168.1.1 80
do
echo "Router is not up yet. Waiting..." >> /home/tc/mail.txt
sleep 5
done
.
/usr/local/bin/curl ifconfig.me >> /home/tc/mail.txt
echo -n " on " >> /home/tc/mail.txt
sleep 30
date >> /home/tc/mail.txt
/usr/local/bin/curl --url smtp://<smtp server>:587 --ssl-reqd --mail-from me@my_email.com --mail-rcpt my_email@gmx.com --upload-file /home/tc/mail.txt --user <from@my_email.com:mypass>
.
.
If I merely reboot the Tiny Core box remotely via SSH everything is fine. However, If I shut down the router and switch it on again (using an sms switch) at the same time as the Tiny Core box boots, it doesn't work, i.e. the date is not written to mail.txt and no email is sent.
I tried to use cron with the @reboot directive but that doesn't seem to do anything in Tiny Core.
Also it would be quite acceptable to get the router address after the boot up process but I can't see how to achieve this so that there is only one check soon after boot.
Any ideas would be greatly appreciated - thanks.
[EDIT]: Added code tags. Rich