#!/bin/sh # # Startup script for pptpd # # chkconfig: 345 85 15 # description: PPTP server # processname: pptpd # config: /etc/pptpd.conf # ### BEGIN INIT INFO # Provides: pptpd # Required-Start: $network # Required-Stop: $network # Default-Start: 3 4 5 # Short-Description: PPTP server # Description: PPTP server ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions # See how we were called. case "$1" in start) gprintf "Starting pptpd: " if [ -f /var/lock/subsys/pptpd ] ; then echo exit 1 fi for i in ppp_generic ppp_async ppp_synctty ppp_mppe ppp_deflate ip_gre; do modprobe $i done daemon /usr/sbin/pptpd echo touch /var/lock/subsys/pptpd ;; stop) gprintf "Shutting down pptpd: " killproc pptpd echo rm -f /var/lock/subsys/pptpd ;; status) status pptpd ;; restart) $0 stop $0 start gprintf "Warning: a pptpd restart does not terminate existing \n" grpintf "connections, so new connections may be assigned the same IP \n" gprintf "address and cause unexpected results. Use restart-kill to \n" gprintf "destroy existing connections during a restart.\n" ;; restart-kill) $0 stop ps -ef | grep pptpd | grep -v grep | grep -v rc.d | awk '{print $2}' | uniq | xargs kill 1> /dev/null 2>&1 $0 start ;; *) gprintf "Usage: %s {start|stop|restart|restart-kill|status}\n" "$0" exit 1 esac exit 0