Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > media > contrib-src > by-pkgid > d0302ff307e7fe7152343c2db22ce25d > files > 6

mserver-0.5.5-1mdk.src.rpm

#!/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() {
	echo -n "Starting Masqdialer server: "
	RETVAL=1
		daemon mserver
		RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/mserver || \
	   RETVAL=1
	return $RETVAL
}	
stop() {
	echo -n "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"
        echo -n "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 || :
	;;
  *)
	echo "Usage: $0 {start|stop|restart|status|condrestart}"
	exit 1
esac

exit $?