Start script on network connect

Posted by Nate Mara on Super User See other posts from Super User or by Nate Mara
Published on 2013-11-08T03:02:12Z Indexed on 2013/11/08 4:00 UTC
Read the original article Hit count: 537

I am trying to get a GNU/Linux Bash script to run as soon as a network connection is established on my Raspberry Pi. I tried following the instructions on several pages:

I have tried adding my script to /etc/network/if-up.d and running sudo chmod ugo+x on the file.

I have tried adding the line post-up <path/to/script.sh> to /etc/network/interfaces

I am really quite clueless here.

More info:

The script runs fine when manually run, here it is: http://pastebin.com/UJvt5HYU (I did remove my personal info (email addresses, passwords), but other than that, the script is unchanged. This script also uses the sendEmail program (can be found at http://caspian.dotconf.net/menu/Software/SendEmail/).

© Super User or respective owner

Related posts about linux

Related posts about bash