mirror of
https://github.com/gryf/wicd.git
synced 2026-01-05 13:24:13 +01: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:
@@ -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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# /etc/rc.d/rc.wicd
|
||||
# Start/stop/restart the Wicd daemon
|
||||
|
||||
# This is defined in /usr/lib/python2.5/site-packages/wicd/wpath.py
|
||||
# This is defined in /usr/lib/python2.6/site-packages/wicd/wpath.py
|
||||
PIDFILE="%PIDFILE%"
|
||||
DAEMON="%SBIN%wicd"
|
||||
|
||||
@@ -21,7 +21,7 @@ wicd_start() {
|
||||
fi
|
||||
}
|
||||
|
||||
wicd_stop() {
|
||||
wicd_force_stop() {
|
||||
echo "Stopping wicd daemon..."
|
||||
if [ -e $PIDFILE ]; then
|
||||
kill $(cat $PIDFILE) 2>/dev/null
|
||||
@@ -31,6 +31,12 @@ wicd_stop() {
|
||||
fi
|
||||
}
|
||||
|
||||
wicd_stop() {
|
||||
echo "Stopping wicd daemon and closing connections..."
|
||||
$DAEMON -k
|
||||
}
|
||||
|
||||
|
||||
# See how we were called and take appropriate action
|
||||
|
||||
case $1 in
|
||||
@@ -40,8 +46,11 @@ case $1 in
|
||||
stop)
|
||||
wicd_stop
|
||||
;;
|
||||
restart)
|
||||
force_stop)
|
||||
wicd_stop
|
||||
;;
|
||||
restart)
|
||||
wicd_force_stop
|
||||
wicd_start
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.\" First revision was r203
|
||||
.TH WICD-CURSES "8" "April 2009" "wicd-curses-%CURSES_REVNO%"
|
||||
.TH WICD-CURSES "8" "December 2009" "wicd-curses-%CURSES_REVNO%"
|
||||
.SH NAME
|
||||
.B wicd-curses
|
||||
\- curses-based wicd(8) controller
|
||||
|
||||
Reference in New Issue
Block a user