updated on Sun Jan 15 04:04:02 UTC 2012
[aur-mirror.git] / connman / connmand-daemon
blobaff1ddeb2eaac01d21eba3c60eba565e96d543a5
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DESC="Connection Manager"
7 NAME="connmand"
8 ARGS=""
9 DAEMON="/usr/sbin/$NAME"
11 PID=`pidof -o %PPID ${DAEMON}`
12 case "$1" in
13 start)
14 stat_busy "Starting ${DESC}"
15 if [ -z "$PID" ]; then
16 ${DAEMON} ${ARGS}
18 if [ ! -z "$PID" -o $? -gt 0 ]; then
19 stat_fail
20 else
21 add_daemon ${NAME}
22 stat_done
25 stop)
26 stat_busy "Stopping ${DESC}"
27 [ ! -z "$PID" ] && killall ${DAEMON} &> /dev/null
28 if [ $? -gt 0 ]; then
29 stat_fail
30 else
31 rm_daemon ${NAME}
32 stat_done
35 restart)
36 $0 stop
37 sleep 1
38 $0 start
41 echo "usage: $0 {start|stop|restart}"
43 esac
44 exit 0