1
0
mirror of https://github.com/gryf/wicd.git synced 2026-04-19 12:13:33 +02:00

Modified two initscripts to support wicd -k, made wicd -k have a non-zero exit code if it can't find a daemon to kill.

This commit is contained in:
Andrew Psaltis
2009-12-29 21:22:23 -05:00
parent ff6cca2528
commit 49ed9f6251
4 changed files with 37 additions and 10 deletions

View File

@@ -22,13 +22,28 @@ start()
echo
[ "$RETVAL" = "0" ] && touch /var/lock/subsys/$servicename
}
stop()
stop()
{
echo -n "Stopping wicd service and closing connections: "
$WICD_BIN -k
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
rm -f /var/lock/subsys/$servicename
rm -f $pidfile
else
echo_failure
fi
echo
}
force_stop()
{
echo -n "Stopping wicd service: "
killproc -p $pidfile wicd
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
if [ $retval -eq 0 ]; then
rm -f /var/lock/subsys/$servicename
rm -f $pidfile
fi
@@ -42,16 +57,19 @@ case "$1" in
stop)
stop
;;
force_stop)
force_stop
;;
status)
status -p $pidfile $processname
RETVAL=$?
;;
restart | reload)
stop
force_stop
start
;;
*)
echo "Usage: wicd {start|stop|status|reload|restart}"
echo "Usage: wicd {start|stop|force_stop|status|reload|restart}"
exit 1
;;
esac