#! /bin/sh # Originated by l3ech, http://l3ech.net/cables_linux_l2tp.php?reverse=on # Modified by Ez-Aton, ezaton_at_no_spam_tournament_dot_org_dot_il # init file. MAKE SURE you don't forget to replace all occurances # of "192.117.122.12" in this file with your L2TP VPN address. # List of VPNs of all Israely ISPs is available at # http://www.cables.org.il/cable-vpn/vpn.html # You need l2tpd running before this script is running. I have added it to /etc/inittab, so it would always be respawn # # chkconfig: 345 10 90 # description: L2TP based dialer startup script # processname: rp-l2tp PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/l2tpd NAME=l2tpd DESC="RP l2tpd" CONTROL=/usr/sbin/l2tp-control test -x $DAEMON || exit 0 set -e case "$1" in start) if [ ! -f /var/lock/no-internet ] ; then echo -n "Starting $DESC: $NAME " fixroute sleep 1 $CONTROL "start-session 192.117.122.12" exit 0 fi echo "File /var/lock/no-internet exists. Remove it to be able to connect" ;; stop) echo -n "Stopping $DESC: $NAME " killall -9 pppd $CONTROL exit echo "." ;; restart) echo -n "Restarting $DESC: $NAME" killall pppd ;; kill) echo -n "Terminating $DESC: $NAME" touch /var/lock/no-internet killall -9 pppd ;; revive) echo -n "Reviving $DESC: $NAME" \rm /var/lock/no-internet fixroute $CONTROL "start-session 192.117.122.12" ;; *) echo "Usage: rp-l2tp {start|stop|restart|kill|revive}" exit 1 ;; esac exit 0