Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 6dba1090944fb72744b92327ab934f73 > files > 4

proftpd-1.2.8-1.2.91mdk.ppc.rpm

#!/bin/sh
#
# Startup script for ProFTPd
#
# chkconfig: 345 85 15
# description: ProFTPD is an enhanced FTP server with \
#               a focus toward simplicity, security, and ease of configuration. \
#              It features a very Apache-like configuration syntax, \
#               and a highly customizable server infrastructure, \
#               including support for multiple 'virtual' FTP servers, \
#               anonymous FTP, and permission-based directory visibility.
# processname: proftpd
# config: /etc/proftpd.conf
#
# By: Osman Elliyasa <osman@Cable.EU.org>
# $Id: proftpd.init.d,v 1.2 2001/01/26 23:10:55 flood Exp $
# modified by vdanen@mandrakesoft.com

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
	exit 0
fi

[ -x /usr/sbin/proftpd ] || exit 0

FTPSHUT=/usr/sbin/ftpshut
RETVAL=0

# See how we were called.
case "$1" in
  start)
	gprintf "Starting proftpd: "
	daemon proftpd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
	;;
  stop)
	gprintf "Shutting down proftpd: "
	killproc proftpd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd
	;;
  status)
	status proftpd
	RETVAL=$?
	;;
  restart)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  reload)
	gprintf "Re-reading proftpd config: "
	killproc proftpd -HUP
	RETVAL=$?
	echo
	;;
  suspend)
  	if [ -f $FTPSHUT ]; then
  		if [ $# -gt 1 ]; then
			shift
			gprintf "Suspending proftpd with '$*' "
			$FTPSHUT $*
		else
			gprintf "Suspending proftpd NOW "
			$FTPSHUT now "Maintanance in progress"
		fi
	else
		gprintf "No way to suspend, shutting down instead "
	fi
	killproc proftpd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd
  	;;
  resume)
	if [ -f /etc/shutmsg ]; then
		gprintf "Allowing proftpd sessions again "
		rm -f /etc/shutmsg
	else
		gprintf "Starting proftpd; was not suspended "
	fi
	daemon proftpd
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
  	;;
  *)
	gprintf "Usage: %s {start|stop|status|restart|reload|resume" "$0"
  	if [ "$FTPSHUT" = "" ]; then
		gprintf "}\n"
	else
		gprintf "|suspend}\n"
		gprintf "suspend accepts additional arguments which are passed to ftpshut(8)\n"
	fi
	exit 1
esac

if [ $# -gt 1 ]; then
	shift
	$0 $*
fi

exit $RETVAL