#---------------------------------------------------------------------------- # /etc/rc.d/rc210.pptp - configuration of PPTP # # Creation: 13.11.2000 fm # Last Update: $Id$ # # Thanks to: # Christian Karner - Austria # Dick van der Kaaden - Netherlands # Rudolf Hämmerle - Austria # Roland Diera ? - Germany #---------------------------------------------------------------------------- case $OPT_PPTP in yes) begin_script CIRCUITS_PPTP "starting pptp ..." dev='pppoe' debug='' usepeerdns='' active_filter=$(ppp_filter_get) [ -n "$active_filter" ] && active_filter="active-filter \"$active_filter\"" if [ "$PPTP_DEBUG" = "yes" ] then debug='debug' fi if [ "$PPTP_USEPEERDNS" = "yes" ] then usepeerdns='usepeerdns' fi echo "\"$PPTP_USER\" * \"$PPTP_PASS\" *" >> /etc/ppp/pap-secrets do_modprobe ppp_async # If fli4lctrl kills pppd, pppd removes defaultroute! # imond cannot set it again, because ppp0 is not longer existant :-( echo $DIALMODE >/var/run/pppoe.dialmode defaultroute='defaultroute' local=10.0.0.140/32 remote=10.0.0.138 ip addr add $local dev $PPTP_ETH ip link set dev $PPTP_ETH up ip route add $remote dev $PPTP_ETH echo $local >/var/run/$dev.conf echo $remote >>/var/run/$dev.conf if [ "$PPTP_MODEM_TYPE" = "mxstream" ] # MXSTREAM in the Netherlands then noipdefault="" else noipdefault="noipdefault" # DSL in Austria fi eval /usr/sbin/pptp \ \$remote \ \$noipdefault \ noauth \ \$defaultroute \ hide-password \ user \"\$PPTP_USER\" \ demand \ persist \ holdoff 3 \ maxfail 0 \ \$usepeerdns \ \$debug \ connect /bin/true \ $active_filter \ idle \$PPTP_HUP_TIMEOUT while [ 1 ] do sleep 5 if [ ! -f /var/run/ppp0.pid ] then set -- `ps | grep [p]ptp` if [ "$1" != "" ] then kill $1 sleep 5 fi eval /usr/sbin/pptp \ \$remote \ \$noipdefault \ noauth \ \$defaultroute \ hide-password \ user \"\$PPTP_USER\" \ demand \ persist \ holdoff 3 \ maxfail 0 \ \$usepeerdns \ \$debug \ connect /bin/true \ $active_filter \ idle \$PPTP_HUP_TIMEOUT fi # check pppd # fm: perhaps it's better to use pid file in /var/run/ set -- `ps | grep [G]RE-to-PPP` if [ "$1" = "" ] then sleep 5 set -- `ps | grep [G]RE-to-PPP` if [ "$1" = "" ] then echo "Connection timed out or disconnected by provider!" echo "Restarting pppd" killall pppd fi fi done & times="$PPTP_TIMES" usepeerdns="$PPTP_USEPEERDNS" name="$PPTP_NAME" chargeint="$PPTP_CHARGEINT" hup_timeout="$PPTP_HUP_TIMEOUT" . /etc/rc.d/dsl-circuit-common end_script ;; esac