summaryrefslogtreecommitdiffstats
path: root/recipes/poptop/files/pptpd.init
blob: 27786cd0c2c8f18fc39385db6ee20116e2aa9c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh

test -f /usr/sbin/pptpd || exit 0
test -f /etc/default/pptpd && . /etc/default/pptpd

case $1 in
  start)
    echo -n "Starting PPTP server: pptpd"
    start-stop-daemon --start --quiet --pidfile /var/run/pptpd.pid \
                      --exec /usr/sbin/pptpd
    echo "."
    ;;
  stop)
    echo -n "Stopping PPTP server: pptpd"
    start-stop-daemon --stop --quiet --pidfile /var/run/pptpd.pid \
                      --exec /usr/sbin/pptpd
    echo "."
    ;;
  status)
    pid=$(pidof pptpd)    	          
    if [ -n "$pid" ] ; then
	    echo "Running with pid $pid"
    else
	    echo "Not running"
    fi
    ;;
  restart|force-reload)
    $0 stop
    $0 start
    ;;
  *)
    echo "Usage: /etc/init.d/pptpd {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

exit 0