2011-12-02 13:13:09 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
prefix=/usr
|
|
|
|
exec_prefix=/usr
|
|
|
|
sbindir=${exec_prefix}/sbin
|
|
|
|
|
|
|
|
NETWORKMANAGER_BIN=${sbindir}/NetworkManager
|
|
|
|
|
|
|
|
[ -x $NETWORKMANAGER_BIN ] || exit 0
|
|
|
|
|
2014-11-26 16:16:13 +01:00
|
|
|
PID=`pidof NetworkManager`
|
2011-12-02 13:13:09 +01:00
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo -n "Starting NetworkManager ... "
|
|
|
|
[ ! -d /var/run/NetworkManager ] && install -d /var/run/NetworkManager
|
|
|
|
if [ -z "$PID" ]; then
|
|
|
|
$NETWORKMANAGER_BIN
|
|
|
|
fi
|
|
|
|
if [ ! -z "$PID" -o $? -gt 0 ]; then
|
|
|
|
echo "failed!"
|
|
|
|
else
|
|
|
|
echo "done."
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
echo -n "Stopping NetworkManager ... "
|
2014-10-26 18:41:45 +01:00
|
|
|
[ ! -z "$PID" ] && kill $PID > /dev/null 2>&1
|
2011-12-02 13:13:09 +01:00
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
echo "failed!"
|
|
|
|
else
|
|
|
|
echo "done."
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
sleep 1
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage: $0 {start|stop|restart|sleep|wake}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|
|
|
|
|