Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/> to /etc/network/interfaces

I am really quite clueless here.

More info:

The script runs fine when manually run, here it is: (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

share|improve this question
We cannot help you if you don't show us the relevant files. Please post your script's code. Does it run OK if you run it manually? Are you using a full path or a relative one? Please always include all the relevant files in your question. – terdon Nov 8 '13 at 3:10
Can you make the script log to a file so that you can see what the script is trying to do, and what it fails on ? Also, have you tried putting the script into /etc/network/if-up.d but make sure it has no file extension ? – Lawrence Nov 8 '13 at 5:10
up vote 0 down vote accepted

I was able to solve this by putting the script into /etc/network/if-up.d/ with no extension.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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