]> git.pld-linux.org Git - packages/proftpd.git/blob - proftpd.init
- cleaning
[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 ]; 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
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                 exit 1
46         fi
47         ;;
48   stop)
49         # Stop daemons.
50         if [ -f /var/lock/subsys/proftpd ]; then
51                 msg_stopping ProFTPD
52                 killproc proftpd
53                 rm -f /var/lock/subsys/proftpd /var/run/proftpd* > /dev/null 2>&1
54         else
55                 msg_not_running ProFTPD
56                 exit 1
57         fi
58         ;;
59   status)
60         status proftpd
61         exit $?
62         ;;
63   restart|reload)
64         $0 stop
65         $0 start
66         ;;
67   *)
68         msg_usage "$0 {start|stop|restart|reload|status}"
69         exit 1
70         ;;
71 esac
72
73 exit $RETVAL
This page took 0.052593 seconds and 4 git commands to generate.