Created
September 19, 2011 13:41
-
-
Save cmavr8/1226522 to your computer and use it in GitHub Desktop.
Simple watchdog script to make sure NetworkManager applet is always running. Nm-applet is restarted after it's exited due to bugs etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This script makes sure nm-applet is always running. | |
echo "Initiating script (`date`)" > /tmp/nm-watchdog | |
while [ 1 == 1 ] | |
do | |
#echo "Checking..." >> /tmp/nm-watchdog | |
tmp=`ps -e |grep nm-applet` | |
if [[ "$tmp" == '' ]] | |
then | |
export DISPLAY=':0.0' | |
nm-applet & | |
echo "NM started!" >> /tmp/nm-watchdog | |
#else | |
#echo "NM is already running" >> /tmp/nm-watchdog | |
fi | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment