1#! /bin/sh
2#
3# RedHat 7.0 init style script
4# oftpd	Start/Stop anon ftp server
5# Uses chkconfig tool to manage runlevel startup
6# To install do the following:
7# cp oftpd /etc/rc.d/init.d/.;chkconfig --add oftpd
8#
9# chkconfig: 345 50 50
10# description:	Basic chroot jailed anon ftp server \
11#               see: http://www.time-travellers.com/oftpd/
12#
13# processname: oftpd
14# pidfile: none
15# config: none, set ==> $OFTPD, $FTPROOT, $USER
16#
17
18#Change these three lines to suit your needs
19OFTPD=/opt/bin/oftpd
20FTPROOT=/var/oftp
21USER=ftp
22
23# Source function library.
24. /etc/init.d/functions
25
26[ -x $OFTPD ] || exit 0
27
28
29start() {
30        echo -n "Starting oftpd: "
31        daemon $OFTPD $USER $FTPROOT
32        RETVAL=$?
33        echo
34        [ $RETVAL -eq 0 ]
35	return $RETVAL
36}
37
38stop() {
39        echo -n "Stopping oftpd services: "
40        killproc oftpd
41        RETVAL=$?
42        echo
43        [ $RETVAL -eq 0 ]
44	return $RETVAL
45}
46
47# See how we were called.
48case "$1" in
49  start)
50	start
51	;;
52  stop)
53	stop
54	;;
55  status)
56	status oftpd
57	;;
58  restart|reload)
59	stop
60	start
61	;;
62  *)
63	echo "Usage: oftpd {start|stop|status|restart|reload|}"
64	exit 1
65esac
66
67exit $RETVAL
68