contrib/networkmanager/networkmanager.rc
Alan Mizrahi 17383bbc1a networkmanager: 1.0.10 -> 1.6.2
- use start-stop-daemon
- fix udev dir
- keep bash-completion config, if in use
- updated README
2017-03-03 20:21:46 +09:00

38 lines
747 B
Bash

#!/bin/sh
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
NAME=networkmanager
USER=root
RUNDIR=/var/run/$NAME
PIDFILE=$RUNDIR/$NAME.pid
PROG="/usr/sbin/NetworkManager"
ARGS=""
case $1 in
start)
install -d -m 755 -o $USER $RUNDIR || exit 1
start-stop-daemon --start --pidfile $PIDFILE --exec $PROG -- $ARGS
;;
stop)
start-stop-daemon --stop --retry 60 --pidfile $PIDFILE --remove-pidfile
;;
restart)
$0 stop
$0 start
;;
status)
start-stop-daemon --status --pidfile $PIDFILE
case $? in
0) echo "$PROG running with pid: $(cat $PIDFILE)" ;;
1) echo "$PROG not running, stale pidfile: $PIDFILE" ;;
3) echo "$PROG not running" ;;
4) echo "Unable to determine program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart|status]"
;;
esac