File rinetd.init of Package rinetd

#!/bin/sh
#
# rinetd A TCP redirection server
#
# chkconfig: - 80 20
# description: rinetd is a TCP redirection server
# processname: rinetd
# config: /etc/rinetd.conf

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

exec="/usr/sbin/rinetd"
prog=$(basename $exec)

lockfile=/var/lock/subsys/$prog

start() {
    echo -n $"Starting $prog: "
	daemon $exec
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
	if [ -f "$lockfile" ]; then
		echo -n $"Reloading $prog: "
		killproc $prog -HUP
		retval=$?
		echo
		return $retval
	else
		restart
	fi
}

force_reload() {
    restart
}

fdr_status() {
    status $prog
}

case "$1" in
    start|stop|restart|reload)
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        fdr_status
        ;;
    condrestart|try-restart)
  	[ ! -f $lockfile ] || restart
	;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
        exit 2
esac