-   Slackware (
-   -   NetworkManager and Custom scripts (

Pratt 12-23-2012 12:17 PM

NetworkManager and Custom scripts
Hello Friends!

Im using network manager (and nm-applet) to manage my connections. What I would like to do automatically, is to run a custom script when I successfuly connect to a wireless network and run another custom script when I close that connection.

Ive been looking around for information about this topic but I havent got any luck finding it. Any Ideas on how to do this?

Happy Holidays!

bijo505 12-23-2012 01:16 PM


I am not sure, whether you are looking like this or not.

GW=<Gateway IP>;
ping -c 1 $GW > /dev/null
[ $exitstatus -eq 0 ] && [ ! -e ~/enable ] && <command to run> && touch ~/enable && exit # This line will execute after getting the connection
[ $exitstatus -ne 0 ] && rm ~/enable && <command to execute> # This line will execute at the end

I hope this logic will work... but didn't check..

allend 12-23-2012 05:35 PM

Perhaps this will help.

All times are GMT -5. The time now is 09:16 PM.