#---------------------------------------------------------------------------- # /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='' if [ "$PPTP_DEBUG" = "yes" ] then debug='debug' fi if [ "$PPTP_USEPEERDNS" = "yes" ] then usepeerdns='usepeerdns' fi if [ "$PPTP_FILTER" = "yes" ] then active_filter='precompiled-active-filter /etc/ppp/filter' 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 $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 /usr/sbin/pptp-bcaa \ $remote \ noauth \ $defaultroute \ hide-password \ user "$PPTP_USER" \ demand \ persist \ holdoff 3 \ maxfail 0 \ $usepeerdns \ $debug \ connect /bin/true \ $active_filter \ idle $PPTP_HUP_TIMEOUT else # DSL in austria /usr/sbin/pptp-$PPTP_MODEM_TYPE \ $remote \ noipdefault \ noauth \ $defaultroute \ hide-password \ name "$PPTP_USER" \ demand \ persist \ holdoff 3 \ maxfail 0 \ $usepeerdns \ $debug \ connect /bin/true \ $active_filter \ idle $PPTP_HUP_TIMEOUT fi 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 if [ "$PPTP_MODEM_TYPE" = "mxstream" ] then # MXSTREAM in the netherlands /usr/sbin/pptp-bcaa \ $remote \ noauth \ $defaultroute \ hide-password \ user "$PPTP_USER" \ demand \ persist \ holdoff 3 \ maxfail 0 \ $usepeerdns \ $debug \ connect /bin/true \ $active_filter \ idle $PPTP_HUP_TIMEOUT else # DSL in austria /usr/sbin/pptp-$PPTP_MODEM_TYPE \ $remote \ noipdefault \ noauth \ $defaultroute \ hide-password \ name "$PPTP_USER" \ demand \ persist \ holdoff 3 \ maxfail 0 \ $usepeerdns \ $debug \ connect /bin/true \ $active_filter \ idle $PPTP_HUP_TIMEOUT fi 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