blob: d1667c5e2c4894519e79ecae56138eb71c6c518d (
plain)
1 #!/bin/sh
2 PATH="/sbin:/usr/sbin:/bin:/usr/bin"
3
4 NAME="NetworkManager"
5 USER="root"
6 RUNDIR="/var/run/$NAME"
7 PIDFILE="$RUNDIR/$NAME.pid"
8 PROG="/usr/sbin/NetworkManager"
9 ARGS=""
10
11
12 case $1 in
13 start)
14 install -d -m 755 -o $USER $RUNDIR || exit 1
15 start-stop-daemon --start --pidfile $PIDFILE --exec $PROG -- $ARGS
16 ;;
17 stop)
18 start-stop-daemon --stop --retry 60 --pidfile $PIDFILE --remove-pidfile
19 ;;
20 restart)
21 $0 stop
22 $0 start
23 ;;
24 status)
25 start-stop-daemon --status --pidfile $PIDFILE
26 case $? in
27 0) echo "$PROG running with pid: $(cat $PIDFILE)" ;;
28 1) echo "$PROG not running, stale pidfile: $PIDFILE" ;;
29 3) echo "$PROG not running" ;;
30 4) echo "Unable to determine program status" ;;
31 esac
32 ;;
33 *)
34 echo "usage: $0 [start|stop|restart|status]"
35 ;;
36 esac
|