diff options
Diffstat (limited to 'package/network-manager/S45network-manager')
-rwxr-xr-x | package/network-manager/S45network-manager | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/package/network-manager/S45network-manager b/package/network-manager/S45network-manager new file mode 100755 index 000000000..112aa660e --- /dev/null +++ b/package/network-manager/S45network-manager @@ -0,0 +1,46 @@ +#!/bin/sh + +prefix=/usr +exec_prefix=/usr +sbindir=${exec_prefix}/sbin + +NETWORKMANAGER_BIN=${sbindir}/NetworkManager + +[ -x $NETWORKMANAGER_BIN ] || exit 0 + +PID=`pidof -o %PPID NetworkManager` +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 ... " + [ ! -z "$PID" ] && kill $PID &> /dev/null + 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 + + + |