Ubuntu 10.04: Scripts saved in /etc/network/if-up.d are not being executed
Hello all,
I'd like the following script to execute every time my wireless network connection begins: #!/bin/sh ifconfig | grep "Bcast" > path/to/my/textfile I want to save this line of info from ifconfig into textfile every time my wireless begins. I saved this code in a script called "getIP" and saved that script in the /etc/network/if-up.d folder, making sure to chmod +x it. But whenever I change wireless networks and get a new IP address, textfile does not update. HOWEVER, when I call . getIP from within the /etc/network/if-up.d folder, textfile updates with the proper information. Could someone please explain what more I need to do to make sure this script runs whenever my computer connects to a wireless network? Thanks, Khiya |
Hello,
Are you using network manager, wicd, or running your network up manually? Also, can you post the contents of the following commands for me? I want to double check the permissions, and the ownership of the file. Code:
ls -al /etc/network/if-up.d/* Josh |
Hi Josh, thanks for the quick response.
A coworker also suggested I try checking those permissions, but he couldn't deduce anything from the output. Does it tell you anything?: Code:
$ ls -al /etc/network/if-up.d/* I've never done anything remotely related to manually managing networking in Linux before, so I assume I'm using wicd. Best, Khiya |
By looking at the contents, I notice other scripts in there. Do any of them run? You also need to check and make sure what connection manager you are using. You can do this by right-clicking on the icon in your task tray, and clicking on "About" or something of that nature.
|
I had assumed they were running. I'm not actually sure how to check. I had at one point tried pasting the contents of my script into the bottom of the "upstart" script, but nothing happened. I assumed that was because my code was wrong, not because "upstart" wasn't running. And I'm using NetworkManager Applet 0.8.
|
All times are GMT -5. The time now is 05:56 AM. |