mirror of
https://github.com/gryf/wicd.git
synced 2026-04-03 19:23:36 +02:00
Merged changes from svenstaro to the Arch init script, and then
did some cleanup edits in this tree.
This commit is contained in:
@@ -1,26 +1,39 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# borrowed from
|
# Arch init script for wicd
|
||||||
# http://repos.archlinux.org/viewvc.cgi/wicd/repos/extra-i686/wicd-daemon?revision=1&view=markup
|
|
||||||
# and modified for 1.5.0
|
|
||||||
|
|
||||||
. /etc/rc.conf
|
. /etc/rc.conf
|
||||||
. /etc/rc.d/functions
|
. /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
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
stat_busy "Starting wicd Daemon"
|
stat_busy "Starting wicd Daemon"
|
||||||
killall wicd &> /dev/null
|
if [ -z "$PID" ]; then
|
||||||
%SBIN%wicd-daemon &> /dev/null
|
$WICD_BIN &> /dev/null
|
||||||
add_daemon wicd
|
fi
|
||||||
stat_done
|
if [ ! -z "$PID" -o $? -gt 0 ]; then
|
||||||
;;
|
stat_fail
|
||||||
|
else
|
||||||
|
add_daemon wicd
|
||||||
|
stat_done
|
||||||
|
fi
|
||||||
|
;;
|
||||||
stop)
|
stop)
|
||||||
stat_busy "Stopping wicd Daemon"
|
stat_busy "Stopping wicd Daemon"
|
||||||
killall wicd &> /dev/null
|
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
||||||
rm_daemon wicd
|
if [ $? -gt 0 ]; then
|
||||||
stat_done
|
stat_fail
|
||||||
;;
|
else
|
||||||
|
rm_daemon wicd
|
||||||
|
stat_done
|
||||||
|
fi
|
||||||
|
;;
|
||||||
restart)
|
restart)
|
||||||
$0 stop
|
$0 stop
|
||||||
sleep 1
|
sleep 1
|
||||||
@@ -29,5 +42,6 @@ case "$1" in
|
|||||||
*)
|
*)
|
||||||
echo "usage: $0 {start|stop|restart}"
|
echo "usage: $0 {start|stop|restart}"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user