]> git.pld-linux.org Git - packages/wicd.git/blob - wicd.init
- removed "wired-settings.conf parse error" TODO (no-deepcopy patch updated)
[packages/wicd.git] / wicd.init
1 #!/bin/sh
2 #
3 # wicd  Wicd Wireless Connection Daemon
4 #
5 # chkconfig:    345 99 01
6 #
7 # description:  Wicd Wireless Connection Daemon
8 #
9 # processname:  wicd
10 # pidfile: /var/run/wicd.pid
11 #
12 # $Id$
13
14 # Source function library
15 . /etc/rc.d/init.d/functions
16
17 # Get network config
18 . /etc/sysconfig/network
19
20 # Get service config - may override defaults
21 [ -f /etc/sysconfig/wicd ] && . /etc/sysconfig/wicd
22
23 # Check that networking is up.
24 if is_yes "${NETWORKING}"; then
25         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
26                 msg_network_down "Wicd Connection Daemon"
27                 exit 1
28         fi
29 else
30         exit 0
31 fi
32
33 start() {
34         # Check if the service is already running?
35         if [ -f /var/lock/subsys/wicd ]; then
36                 msg_already_running "Wicd Connection Daemon"
37                 return
38         fi
39
40         msg_starting "Wicd Connection Daemon"
41         daemon /usr/sbin/wicd
42         RETVAL=$?
43         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/wicd
44 }
45
46 stop() {
47         if [ ! -f /var/lock/subsys/wicd ]; then
48                 msg_not_running "Wicd Connection Daemon"
49                 return
50         fi
51
52         # Stop daemons.
53         msg_stopping "Wicd Connection Daemon"
54         killproc --pidfile /var/run/wicd.pid wicd -TERM
55         rm -f /var/lock/subsys/wicd
56 }
57
58 condrestart() {
59         if [ ! -f /var/lock/subsys/wicd ]; then
60                 msg_not_running "Wicd Connection Daemon"
61                 RETVAL=$1
62                 return
63         fi
64
65         stop
66         start
67 }
68
69 RETVAL=0
70 # See how we were called.
71 case "$1" in
72   start)
73         start
74         ;;
75   stop)
76         stop
77         ;;
78   restart)
79         stop
80         start
81         ;;
82   try-restart)
83         condrestart 0
84         ;;
85   force-reload)
86         condrestart 7
87         ;;
88   status)
89         status --pidfile /var/run/wicd.pid wicd
90         RETVAL=$?
91         ;;
92   *)
93         msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
94         exit 3
95 esac
96
97 exit $RETVAL
This page took 0.06973 seconds and 3 git commands to generate.