#!/bin/sh
#
# Startup script for vpn-gazduire
#
# chkconfig: - 85 15
# description: VPN gazduire.ro
# processname: vpn-gazduire
# config: /etc/ppp/peers/vpn-gazduire


# Source function library.
. /etc/rc.d/init.d/functions
# See how we were called.
case "$1" in
  start)
        echo -n "Enabling VPN (gazduire.ro): "
        #if [ -f /var/lock/subsys/pppd ] ; then
        #        echo
        #        exit 1
        #fi
        daemon /usr/sbin/pppd call vpn_gazduire.ro
	sleep 5
	/etc/ppp/ip-up.d/route-traffic
        echo
        touch /var/lock/subsys/pppd
        ;;
  stop)
        echo -n "Disabling VPN (gazduire.ro): "
        killproc pppd
        echo
        rm -f /var/lock/subsys/pppd
        ;;
  status)
        status pppd
        ;;
  condrestart)
	if [ -f /var/lock/subsys/pppd ]; then
		$0 stop
		$0 start
	fi
	;;
  reload|restart)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
esac

exit 0
