#!/bin/sh #--------------------------------------------------------------- # chkconfig: - 90 10 # description: This startup script launches pptp-command. #--------------------------------------------------------------- ### BEGIN INIT INFO # Provides: pptp # Required-Start: network # Required-Stop: network # Default-Start: # Default-Stop: 0 1 2 3 4 5 6 # Description: PPTP based VPN ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions ret=0 case $1 in start) gprintf "Starting pptp: " /sbin/modprobe ppp-compress-18 /usr/sbin/pptp-command start > /dev/null 2>&1 ret=$? if [ $ret = 0 ]; then success "Pptp startup" touch /var/lock/subsys/pptp else failure "Pptp startup" fi echo ;; stop) gprintf "Stopping pptp: " if [ -r /var/lock/subsys/pptp ]; then /usr/sbin/pptp-command stop > /dev/null 2>&1 /sbin/modprobe -r ppp-compress-18 fi ret=$? if [ $ret = 0 ]; then success "Pptp shutdown" rm -f /var/lock/subsys/pptp else failure "Pptp shutdown" fi echo ;; status) status pptp ;; reload) ;; restart) $0 stop # give a chance to the X server to stop gracefully sleep 5 $0 start ret=$? ;; *) gprintf "Usage: %s\n" "$(basename $0) {start|stop|restart|status}" exit 0 ;; esac exit $ret # pptp ends here