Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-23-2012, 01:17 PM   #1
Registered: Apr 2005
Location: Between Colombia and Germany
Distribution: Slackware Current
Posts: 78

Rep: Reputation: 15
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!
Old 12-23-2012, 02:16 PM   #2
Registered: Nov 2012
Location: Bangalore
Distribution: Fedora & Ubuntu
Posts: 77

Rep: Reputation: 18

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

Last edited by bijo505; 12-24-2012 at 01:05 AM. Reason: Exit status was not properly mentioned.
Old 12-23-2012, 06:35 PM   #3
Senior Member
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,044

Rep: Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115
Perhaps this will help.


network manager, nm-applet

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installation user scripts to custom packages selection beder Slackware 7 04-19-2011 02:34 PM
Suspend/Resume - custom scripts and mouse issues Arcalyth Linux - Laptop and Netbook 0 02-17-2009 06:30 PM
Place for custom made system scripts the_gripmaster Linux - General 5 11-26-2008 05:29 PM
MRTG Custom Scripts Analysis RaelOM Linux - Software 2 07-11-2006 11:13 AM
Custom scripts Minnie000 Linspire/Freespire 1 04-24-2005 04:30 PM

All times are GMT -5. The time now is 12:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration