]> git.pld-linux.org Git - packages/PyICQt.git/blob - PyICQt.init
- use functions
[packages/PyICQt.git] / PyICQt.init
1 #!/bin/sh
2 # Jabber ICQ transport
3 #
4 # chkconfig:    345 85 05
5 # description:  Jabber ICQ transport
6
7 # Source function library
8 . /etc/rc.d/init.d/functions
9
10 # Get network config
11 . /etc/sysconfig/network
12
13 # Check that networking is up.
14 if is_yes "${NETWORKING}"; then
15         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
16                 msg_network_down pyICQt
17                 exit 1
18         fi
19 else
20         exit 0
21 fi
22
23 start() {
24         # Check if the service is already running?
25         if [ ! -f /var/lock/subsys/PyICQt ]; then
26                 msg_starting "Jabber ICQ transport"
27                 daemon /usr/sbin/pyicqt.sh /etc/jabber/PyICQt.xml
28                 RETVAL=$?
29                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/PyICQt
30         else
31                 msg_already_running PyICQt
32         fi
33 }
34
35 stop() {
36         # Check if the service is already running?
37         if [ -f /var/lock/subsys/PyICQt ]; then
38                 msg_stopping  "Jabber ICQ transport"
39                 killproc --pidfile /var/run/PyICQt.pid PyICQt
40                 rm -f /var/lock/subsys/PyICQt
41         else
42                 msg_not_running PyICQt
43         fi
44 }
45
46 RETVAL=0
47 # See how we were called.
48 case "$1" in
49   start)
50         start
51         ;;
52   stop)
53         stop
54         ;;
55   restart|force-reload)
56         stop
57         start
58         exit $?
59         ;;
60   status)
61         status PyICQt.py
62         exit $?
63         ;;
64   *)
65         msg_usage "$0 {start|stop|restart|force-reload|status}"
66         exit 3
67 esac
68
69 exit $RETVAL
This page took 0.036567 seconds and 4 git commands to generate.