| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Startup script for ProFTPD |
| 4 |
# description: ProFTPD is an enhanced FTP server with \ |
| 5 |
# a focus toward simplicity, security, and ease of configuration. \ |
| 6 |
# It features a very Apache-like configuration syntax, \ |
| 7 |
# and a highly customizable server infrastructure, \ |
| 8 |
# including support for multiple 'virtual' FTP servers, \ |
| 9 |
# anonymous FTP, and permission-based directory visibility. |
| 10 |
# processname: proftpd |
| 11 |
# config: /etc/proftpd.conf |
| 12 |
# |
| 13 |
# By: Daniel Weuthen <[email protected]> |
| 14 |
|
| 15 |
. /etc/rc.status |
| 16 |
|
| 17 |
PATH="$PATH:/usr/local/sbin" |
| 18 |
BIN="/usr/sbin/proftpd" |
| 19 |
|
| 20 |
# See how we were called. |
| 21 |
case "$1" in |
| 22 |
start) |
| 23 |
echo -n "Starting proftpd: " |
| 24 |
startproc $BIN $OPTIONS |
| 25 |
touch /var/lock/subsys/proftpd |
| 26 |
rc_status -v |
| 27 |
;; |
| 28 |
stop) |
| 29 |
echo -n "Shutting down proftpd: " |
| 30 |
killproc proftpd |
| 31 |
rm -f /var/lock/subsys/proftpd |
| 32 |
rc_status -v |
| 33 |
;; |
| 34 |
status) |
| 35 |
echo -n "Checking status of proftpd: " |
| 36 |
checkproc proftpd |
| 37 |
rc_status -v |
| 38 |
;; |
| 39 |
restart) |
| 40 |
$0 stop |
| 41 |
$0 start |
| 42 |
;; |
| 43 |
reread) |
| 44 |
echo -n "Re-reading proftpd config: " |
| 45 |
killproc proftpd -HUP |
| 46 |
rc_status -v |
| 47 |
;; |
| 48 |
suspend) |
| 49 |
hash ftpshut >/dev/null 2>&1 |
| 50 |
if [ $? = 0 ]; then |
| 51 |
if [ $# -gt 1 ]; then |
| 52 |
shift |
| 53 |
echo -n "Suspending with '$*' " |
| 54 |
ftpshut $* |
| 55 |
else |
| 56 |
echo -n "Suspending NOW " |
| 57 |
ftpshut now "Maintanance in progress" |
| 58 |
fi |
| 59 |
else |
| 60 |
echo -n "No way to suspend " |
| 61 |
fi |
| 62 |
rc_status -v |
| 63 |
;; |
| 64 |
resume) |
| 65 |
if [ -f /etc/shutmsg ]; then |
| 66 |
echo -n "Allowing sessions again " |
| 67 |
rm -f /etc/shutmsg |
| 68 |
else |
| 69 |
echo -n "Was not suspended " |
| 70 |
fi |
| 71 |
rc_status -v |
| 72 |
;; |
| 73 |
*) |
| 74 |
echo -n "Usage: $0 {start|stop|restart|status|reread|resume" |
| 75 |
hash ftpshut |
| 76 |
if [ $? = 1 ]; then |
| 77 |
echo '}' |
| 78 |
else |
| 79 |
echo '|suspend}' |
| 80 |
echo 'suspend accepts additional arguments which are passed to ftpshut(8)' |
| 81 |
fi |
| 82 |
exit 1 |
| 83 |
esac |
| 84 |
|
| 85 |
if [ $# -gt 1 ]; then |
| 86 |
shift |
| 87 |
$0 $* |
| 88 |
fi |
| 89 |
|
| 90 |
exit 0 |