From 202a1aae9cc8e3df809a7f5343dc8fd969b4429f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 11 Nov 2005 20:48:14 +0000 Subject: [PATCH] add lcp ping to ppp ifup script so that it timeouts properly (fixes #42) SVN-Revision: 2433 --- openwrt/package/ppp/files/ifup.pppoe | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/openwrt/package/ppp/files/ifup.pppoe b/openwrt/package/ppp/files/ifup.pppoe index 80d44783b6..bf1fa1f792 100644 --- a/openwrt/package/ppp/files/ifup.pppoe +++ b/openwrt/package/ppp/files/ifup.pppoe @@ -16,10 +16,17 @@ while :; do IFNAME=$(nvram get pppoe_ifname) USERNAME=$(nvram get ppp_username) PASSWORD=$(nvram get ppp_passwd) - REDIAL=$(nvram get ppp_redialperiod) - REDIAL=${REDIAL:+lcp-echo-interval $REDIAL} - IDLETIME=$(nvram get ppp_idletime) - IDLETIME=${IDLETIME:+lcp-echo-failure $IDLETIME} + KEEPALIVE=$(nvram get ppp_redialperiod) + KEEPALIVE=${KEEPALIVE:+lcp-echo-interval 10 lcp-echo-failure $KEEPALIVE} + DEMAND=$(nvram get ppp_demand) + case "$DEMAND" in + on|1|enabled) + DEMAND=$(nvram get ppp_idletime) + DEMAND=${IDLETIME:+demand idle $IDLETIME} + ;; + *) DEMAND="";; + esac + MTU=$(nvram get ppp_mtu) MTU=${MTU:-1492} @@ -36,7 +43,7 @@ while :; do password "$PASSWORD" \ mtu $MTU \ mru $MTU \ - $IDLETIME \ - $REDIAL \ + $DEMAND \ + $KEEPALIVE \ nic-$IFNAME done & -- 2.30.2