2006-03-27 Dan Williams <dcbw@redhat.com>

Patch from Diffe <diffie@blazebox.homeip.net>
     * initscript/Slackware/rc.networkmanager
     	- update, fixed gnome.org #333368


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1648 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2006-03-27 18:13:05 +00:00
parent 0695a8e944
commit c5a395f65d
2 changed files with 64 additions and 35 deletions

View file

@ -1,3 +1,9 @@
2006-03-27 Dan Williams <dcbw@redhat.com>
Patch from Diffe <diffie@blazebox.homeip.net>
* initscript/Slackware/rc.networkmanager
- update, fixed gnome.org #333368
2006-03-27 Robert Love <rml@novell.com>
* gnome/applet/other-network-dialog.c: Do not allow the user to try to

View file

@ -11,56 +11,79 @@
# We need /sbin/ip
[ -x /sbin/ip ] || exit 1
processname=NetworkManager
servicename=NetworkManager
pidfile=/var/run/NetworkManager.pid
PIDFILE=/var/run/NetworkManager.pid
RETVAL=0
start()
nm_start()
{
if [ "`pgrep dbus-daemon`" = "" ]; then
echo -n "D-BUS must be running to start NetworkManager"
exit 1
echo "D-BUS must be running to start NetworkManager"
return
fi
if [ "`pgrep hald`" = "" ]; then
echo -n "HAL must be running to start NetworkManager"
exit 1
echo "HAL must be running to start NetworkManager"
return
fi
echo -n $"Starting NetworkManager daemon: "
$servicename
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && echo `/sbin/pidof $processname` > $pidfile
# Just in case the pidfile is still there, we may need to nuke it.
if [ -e "$PIDFILE" ]; then
rm -f $PIDFILE
fi
echo "Starting NetworkManager daemon: /usr/sbin/NetworkManager"
/usr/sbin/NetworkManager
}
stop()
nm_status()
{
echo -n $"Stopping NetworkManager daemon: "
killall -s TERM $servicename
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f $pidfile
fi
local pidlist=`cat $PIDFILE 2>/dev/null`
if [ -z "$pidlist" ]; then
return 1
fi
local command=`ps -p $pidlist -o comm=`
if [ "$command" != 'NetworkManager' ]; then
return 1
fi
}
nm_stop()
{
echo -en "Stopping NetworkManager: "
local pidlist=`cat $PIDFILE 2>/dev/null`
if [ ! -z "$pidlist" ]; then
kill $pidlist &>/dev/null
rm -f $PIDFILE &>/dev/null
fi
echo "stopped";
}
nm_restart()
{
nm_stop
nm_start
}
# See how we were called.
case "$1" in
start)
start
'start')
if ( ! nm_status ); then
nm_start
else
echo "NetworkManager is already running (will not start it twice)."
fi
;;
stop)
stop
'stop')
nm_stop
;;
restart)
stop
start
'restart')
nm_restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
'status')
if ( nm_status ); then
echo "NetworkManager is currently running"
else
echo "NetworkManager is not running."
fi
;;
*)
echo "usage $0 start|stop|status|restart"
esac
exit $RETVAL