#!/bin/sh
#
# pptpd         This shell script takes care of starting and stopping
#               pptp daemon.
#
# chkconfig: 2345 80 30
#
# description: PPTP is a Point-To-Point Tunnelling Protocol

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

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

SourceIfNotEmpty /etc/sysconfig/pptpd

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

[ -f /usr/sbin/pptpd ] || exit 0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting pptpd: "
        daemon pptpd $ARGS
        echo
        touch /var/lock/subsys/pptpd
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down pptpd: "
	killproc pptpd
        echo
        rm -f /var/lock/subsys/pptpd
        ;;
  status)
	status pptpd
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: pptpd {start|stop|restart|reload|status}"
        exit 1
esac

exit 0
