run script when wwan0 interface obtains IP address
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I gotta be honest with you, I had this same conundrum a few years ago and I solved it with brute force which was to have another script or program run for a long, but finite period of time, say 2 minutes and poll the interface status, and by observing the status, I'd be able to detect if an address was negotiated versus not. Then following that I gave status back to my GUI, but similarly I could've then invoked a script. I did nothing more than parsed the output of ifconfig for that interface to determine if a valid address was set for that interface. Say maybe did that once every 5 seconds for a count of 24 iterations before I gave up.
If you use NetworkManager, then perhaps you could use a script in /etc/NetworkManager/dispatcher.d/ that checks the interface name and the appropriate dhcp change action (either v4 or v6) to signal whether further commands should be run. See 'man NetwrkManager' for details.
As an example, here is the script I use to change firewall rules depending on the interface in use on my netbook. http://www.linuxquestions.org/questi...1/#post4579765
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.