]> git.pld-linux.org Git - packages/wicd.git/blob - wicd.init
- cp ../BUILD/wicd-1.6.2.2/init/pld/wicd
[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 # config:
11 # pidfile: /var/run/wicd.pid
12 #
13 # $Id$
14
15 # Source function library
16 . /etc/rc.d/init.d/functions
17
18
19 # Get service config - may override defaults
20 # [ -f /etc/sysconfig/wicd ] && . /etc/sysconfig/wicd
21
22 WICD_BIN=/usr/sbin/wicd
23 WICD_PIDFILE=/var/run/wicd.pid
24 WICD_LOCKFILE=/var/lock/subsys/wicd
25
26 start() {
27         # Check if the service is already running?
28         if [ ! -f $WICD_LOCKFILE ]; then
29                 msg_starting wicd
30                 daemon $WICD_BIN
31                 RETVAL=$?
32                 [ $RETVAL -eq 0 ] && touch $WICD_LOCKFILE
33         else
34                 msg_already_running wicd
35         fi
36 }
37
38 stop() {
39         if [ -f $WICD_LOCKFILE ]; then
40                 # Stop daemons.
41                 msg_stopping wicd
42                 # killproc wicd
43                 killproc --pidfile $WICD_PIDFILE wicd -TERM
44                 rm -f $WICD_LOCKFILE
45         else
46                 msg_not_running wicd
47         fi
48 }
49
50
51 condrestart() {
52         if [ -f $WICD_LOCKFILE ]; then
53                 stop
54                 start
55         else
56                 msg_not_running wicd
57                 RETVAL=$1
58         fi
59 }
60
61 RETVAL=0
62 # See how we were called.
63 case "$1" in
64   start)
65         start
66         ;;
67   stop)
68         stop
69         ;;
70   restart)
71         stop
72         start
73         ;;
74   try-restart)
75         condrestart 0
76         ;;
77 # use this one if program doesn't support reloading without restart
78   force-reload)
79         condrestart 7
80         ;;
81   status)
82         status --pidfile $WICD_PIDFILE wicd
83         RETVAL=$?
84         ;;
85   *)
86         msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
87         exit 3
88 esac
89
90 exit $RETVAL
This page took 0.071212 seconds and 4 git commands to generate.