#!/bin/bash
#
#	/etc/rc.d/init.d/serproxy
#
#	provides network access to serial ports
#
# chkcopnfig: 345 99 01
# description: provides network access to serial ports
# processname: serproxy
# config: /etc/serproxy.cfg
#
#
# <tags -- see below for tag definitions.  *Every line* from the top
#  of the file to the end of the tags section must begin with a #
#  character.  After the tags section, there should be a blank line.
#  This keeps normal comments in the rest of the file from being
#  mistaken for tags, should they happen to fit the pattern.>

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

[ -f /etc/sysconfig/serproxy ] && . /etc/sysconfig/serproxy

start() {
	echo -n "Starting serproxy: "
	daemon /usr/libexec/serproxy $SERPROXYOPTS &
        ret=$?
        [ $ret -eq 0 ] && touch /var/lock/subsys/serproxy
        echo
        return $ret
}	

stop() {
	echo -n "Shutting down serproxy: "
	killproc serproxy
	ret=$?
	[ $ret -eq 0 ] && rm -f /var/lock/subsys/xfs
	echo
	return $ret
}

case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    status)
	;;
    restart)
    	stop
	start
	;;
    condrestart)
	[ -f /var/lock/subsys/<service> ] && restart || :
	;;
    *)
	echo "Usage: serproxy {start|stop|status|restart|condrestart}"
	exit 1
	;;
esac
exit $?
