#!/bin/sh # # chkconfig: 345 93 36 # description: Starts and stops the mserver \ # used to provide Internet access. # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0 fi # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 # Check that mserver.conf exists. [ -f /etc/mserver.conf ] || exit 0 RETVAL=0 start() { gprintf "Starting Masqdialer server: " RETVAL=1 daemon mserver RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mserver || \ RETVAL=1 return $RETVAL } stop() { gprintf "Shutting down Masqdialer server: " RETVAL=1 killproc mserver RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mserver return $RETVAL } restart() { stop start } reload() { export TMPDIR="/var/tmp" gprintf "Reloading Masqdialer server: " killproc mserver -HUP RETVAL=$? echo return $RETVAL } mdkstatus() { status mserver } case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; status) mdkstatus ;; condrestart) [ -f /var/lock/subsys/mserver ] && restart || : ;; *) gprintf "Usage: %s {start|stop|restart|status|condrestart}\n" "$0" exit 1 esac exit $?