#!/bin/sh
#
# pptpd		This shell script takes care of starting and stopping
#		the point-to-point tunneling protocol daemon
#
# chkconfig: - 85 15
# description: PPTPd, Point-to-Point Tunnelling Protocol Daemon, offers out \
# connections to pptp clients to become virtual members of the IP pool \
# owned by the pptp server. In effect, these clients become virtual \
# members of the local subnet, regardless of what their real IP address is. \
# Startup script for pptpd
# processname: pptpd
# config: /etc/pptpd.conf
# $Id: pptpd.init,v 1.1 2003/10/09 14:21:19 dude Exp $
#

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

prog="pptpd"

start() {
	# Load required connection tracking and network address
	# translation modules
        modprobe ip_conntrack_pptp ip_nat_pptp >/dev/null 2>&1
	# Start service.
	echo -n $"Starting $prog: "
	daemon /usr/sbin/pptpd
	touch /var/lock/subsys/pptpd
	echo
}

stop() {
	# Stop service.
	echo -n $"Shutting down $prog: "
	killproc /usr/sbin/pptpd
	rm -f /var/lock/subsys/pptpd
	echo
}


# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
	status /usr/sbin/pptpd
	;;
  restart|reload)
	stop
	start
	;;
  condrestart)
	[ -e /var/lock/subsys/pptpd ] && (stop; start)
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
	exit 1
esac

exit 0
