]> git.pld-linux.org Git - packages/proftpd.git/blob - proftpd.init
- fixed previous change
[packages/proftpd.git] / proftpd.init
1 #!/bin/sh
2 #
3 # proftpd       ProFTPD ftp server
4 #
5 # chkconfig:    345 85 15
6 # description:  ProFTPD is a highly configurable ftp daemon for unix and unix-like
7 #               operating systems.
8 # processname:  proftpd
9 # pidfile:      /var/run/proftpd.pid
10 # config:       /etc/ftpd/proftpd.conf
11
12
13 # Source function library
14 . /etc/rc.d/init.d/functions
15
16 # Get network config
17 . /etc/sysconfig/network
18
19 # Get service config
20 [ -f /etc/sysconfig/proftpd ] && . /etc/sysconfig/proftpd
21
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25                 # nls "ERROR: Networking is down. %s can't be run." <service>
26                 msg_network_down proftpd
27                 exit 1
28         fi
29 else
30         exit 0
31 fi
32
33 RETVAL=0
34 # See how we were called.
35 case "$1" in
36   start)
37         # Check if the service is already running?
38         if [ ! -f /var/lock/subsys/proftpd ]; then
39                 msg_starting ProFTPD
40                 daemon proftpd $PROFTPD_OPTS
41                 RETVAL=$?
42                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
43         else
44                 msg_already_running ProFTPD
45         fi
46         ;;
47   stop)
48         # Stop daemons.
49         if [ -f /var/lock/subsys/proftpd ]; then
50                 msg_stopping ProFTPD
51                 killproc proftpd
52                 rm -f /var/lock/subsys/proftpd /var/run/proftpd* > /dev/null 2>&1
53         else
54                 msg_not_running ProFTPD
55         fi
56         ;;
57   status)
58         status proftpd
59         exit $?
60         ;;
61   restart|force-reload)
62         $0 stop
63         $0 start
64         exit $?
65         ;;
66   *)
67         msg_usage "$0 {start|stop|restart|force-reload|status}"
68         exit 3
69 esac
70
71 exit $RETVAL
This page took 0.042067 seconds and 4 git commands to generate.