]> git.pld-linux.org Git - packages/proftpd.git/blob - proftpd.init
- unify caps
[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                 msg_network_down proftpd
26                 exit 1
27         fi
28 else
29         exit 0
30 fi
31
32 start() {
33         # Check if the service is already running?
34         if [ ! -f /var/lock/subsys/proftpd ]; then
35                 msg_starting ProFTPD
36                 daemon proftpd $PROFTPD_OPTS
37                 RETVAL=$?
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
39         else
40                 msg_already_running ProFTPD
41         fi
42 }
43
44 stop() {
45         # Stop daemons.
46         if [ -f /var/lock/subsys/proftpd ]; then
47                 msg_stopping ProFTPD
48                 killproc proftpd
49                 rm -f /var/lock/subsys/proftpd /var/run/proftpd* > /dev/null 2>&1
50         else
51                 msg_not_running ProFTPD
52         fi
53 }
54
55
56 condrestart() {
57         if [ -f /var/lock/subsys/proftpd ]; then
58                 stop
59                 start
60         else
61                 msg_not_running ProFTPD
62                 RETVAL=$1
63         fi
64 }
65
66 RETVAL=0
67 # See how we were called.
68 case "$1" in
69   start)
70         start
71         ;;
72   stop)
73         stop
74         ;;
75   restart)
76         stop
77         start
78         ;;
79   try-restart)
80         condrestart 0
81         ;;
82   force-reload)
83         condrestart 7
84         ;;
85   status)
86         status proftpd
87         exit $?
88         ;;
89   *)
90         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
91         exit 3
92 esac
93
94 exit $RETVAL
This page took 0.071643 seconds and 3 git commands to generate.