1#!/bin/sh 2# Copyright Rene Mayrhofer, ViaNova, 1999 3# This script is distibuted under the GPL 4 5PATH=/bin:/usr/bin:/sbin:/usr/sbin 6DAEMON=/usr/sbin/pptpd 7PIDFILE=/var/run/pptpd.pid 8FLAGS="defaults 50" 9 10case "$1" in 11 start) 12 echo -n "Starting PPTP Daemon: " 13 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \ 14 -- < /dev/null > /dev/null 15 echo "pptpd." 16 ;; 17 stop) 18 echo -n "Stopping PPTP: " 19 start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON 20 echo "pptpd." 21 ;; 22 reload) 23 echo "Not implemented." 24 ;; 25 force-reload|restart) 26 echo "Restarting PPTP: " 27 sh $0 stop 28 sh $0 start 29 ;; 30 status) 31 if [ ! -r $PIDFILE ]; then 32 # no pid file, process doesn't seem to be running correctly 33 exit 3 34 fi 35 PID=`cat $PIDFILE | sed 's/ //g'` 36 EXE=/proc/$PID/exe 37 if [ -x "$EXE" ] && 38 [ "`ls -l \"$EXE\" | cut -d'>' -f2,2 | cut -d' ' -f2,2`" = \ 39 "$DAEMON" ]; then 40 # ok, process seems to be running 41 exit 0 42 elif [ -r $PIDFILE ]; then 43 # process not running, but pidfile exists 44 exit 1 45 else 46 # no lock file to check for, so simply return the stopped status 47 exit 3 48 fi 49 ;; 50 *) 51 echo "Usage: /etc/init.d/pptpd {start|stop|restart|force-reload|reload}" 52 exit 1 53 ;; 54esac 55 56exit 0 57