1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-04 04:44:12 +01:00
Files
wicd/in/init=arch=wicd.in
Robby Workman 7765abf9b5 Merged changes from svenstaro to the Arch init script, and then
did some cleanup edits in this tree.
2009-01-28 19:28:05 -06:00

48 lines
679 B
Bash
Executable File

#!/bin/bash
# Arch init script for wicd
. /etc/rc.conf
. /etc/rc.d/functions
WICD_BIN=%SBIN%wicd
if [ -f /var/run/wicd/wicd.pid ]; then
PID="$(cat /var/run/wicd/wicd.pid)"
fi
case "$1" in
start)
stat_busy "Starting wicd Daemon"
if [ -z "$PID" ]; then
$WICD_BIN &> /dev/null
fi
if [ ! -z "$PID" -o $? -gt 0 ]; then
stat_fail
else
add_daemon wicd
stat_done
fi
;;
stop)
stat_busy "Stopping wicd Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon wicd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0