daily pastebin goal
95%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          pptpd
  4. # Required-Start:    $remote_fs $syslog
  5. # Required-Stop:     $remote_fs $syslog
  6. # Default-Start:     2 3 4 5
  7. # Default-Stop:      0 1 6
  8. ### END INIT INFO
  9. # Copyright Rene Mayrhofer, Gibraltar, 1999
  10. # This script is distibuted under the GPL
  11.  
  12. PATH=/bin:/usr/bin:/sbin:/usr/sbin
  13. DAEMON=/usr/sbin/pptpd
  14. PIDFILE=/var/run/pptpd.pid
  15. FLAGS="defaults 50"
  16.  
  17. case "$1" in
  18.   start)
  19.     echo -n "Starting PPTP Daemon: "
  20.     start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
  21.         -- < /dev/null > /dev/null
  22.     echo "pptpd."
  23.     ;;
  24.   stop)
  25.     echo -n "Stopping PPTP: "
  26.     start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
  27.     echo "pptpd."
  28.     ;;
  29.   force-reload|restart)
  30.     echo "Restarting PPTP: "
  31.     sh $0 stop
  32.     sh $0 start
  33.     ;;
  34.     status)
  35.         if [ ! -r $PIDFILE ]; then
  36.             # no pid file, process doesn't seem to be running correctly
  37.             exit 3
  38.         fi
  39.         PID=`cat $PIDFILE | sed 's/ //g'`
  40.         EXE=/proc/$PID/exe
  41.         if [ -x "$EXE" ] &&
  42.                 [ "`ls -l \"$EXE\" | cut -d'>' -f2,2 | cut -d' ' -f2,2`" = \
  43.                 "$DAEMON" ]; then
  44.             # ok, process seems to be running
  45.             exit 0
  46.         elif [ -r $PIDFILE ]; then
  47.             # process not running, but pidfile exists
  48.             exit 1
  49.         else
  50.             # no lock file to check for, so simply return the stopped status
  51.             exit 3
  52.         fi
  53.         ;;
  54.   *)
  55.     echo "Usage: /etc/init.d/pptpd {start|stop|restart|force-reload}"
  56.     exit 1
  57.     ;;
  58. esac
  59.  
  60. exit 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top