~rrt/wicd/tray-icon

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /bin/sh
#
# /etc/init.d/wicd
#
# chkconfig: - 98 02
# description: Wicd is a wireless and wired network manager for Linux.

# Source function library.
. /etc/rc.d/init.d/functions


WICD_BIN=%SBIN%wicd

pidfile=%PIDFILE%
servicename=wicd
processname=wicd
start()
{
        echo -n "Starting wicd service: "
        daemon $WICD_BIN 2> /dev/null
        RETVAL=$?
        echo
        [ "$RETVAL" = "0" ] && touch /var/lock/subsys/$servicename
}
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
                rm -f /var/lock/subsys/$servicename
                rm -f $pidfile
        fi
}


case "$1" in
        start)
                start
        ;;
        stop)
                stop
        ;;
	force_stop)
		force_stop
	;;
        status)
                status -p $pidfile $processname
                RETVAL=$?
        ;;
        restart | reload)
                force_stop
                start
        ;;
        *)
                echo "Usage: wicd {start|stop|force_stop|status|reload|restart}"
                exit 1
        ;;
esac
exit $RETVAL