Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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/).

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
add comment

1 Answer 1

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

share|improve this answer
add comment

Your Answer

 
discard

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.