Ubuntu 10.04: Scripts saved in /etc/network/if-up.d are not being executed
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.