1
0
mirror of https://github.com/gryf/wicd.git synced 2026-02-02 14:15:47 +01:00
Files
wicd/data/init/arch/wicd
gryf 0ef443f97c Removed bin/sbin out of config options.
Let's do this in pythonic way, optionally leave the decision to package
maintainers, where to put binaries.
2020-08-31 21:12:30 +02:00

59 lines
908 B
Bash
Executable File

#!/bin/bash
# Arch init script for wicd
. /etc/rc.conf
. /etc/rc.d/functions
WICD_BIN="/usr/bin/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"
$WICD_BIN -k
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon wicd
stat_done
fi
;;
force_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 force_stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|force_stop|stop|restart}"
esac
exit 0