From b614536b6f450d1b83166d93d446b12b1061fc6f Mon Sep 17 00:00:00 2001 From: Zeno Zeng Date: Wed, 1 Oct 2014 04:10:17 +0800 Subject: [PATCH] flush lns, fixes #39 --- README.md | 8 ++++++++ build/build.sh | 2 +- lib/route.sh | 10 ++++++++++ lib/xl2tpd.sh | 3 +-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 87a0c0b..245dfa1 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,14 @@ cd zjunet sudo ./install.sh ``` +## Known Issues + +### ppp0 may disappear on openwrt + +make /etc/ppp/options's lcp-echo-failure larger. + +see also https://github.com/QSCTech/zjunet/issues/39 + ## Openwrt Install xl2tpd: diff --git a/build/build.sh b/build/build.sh index c2a7424..186b284 100755 --- a/build/build.sh +++ b/build/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=0.1.0-8 +VERSION=0.1.0-17 cd debian ./build.sh $VERSION > /dev/null diff --git a/lib/route.sh b/lib/route.sh index f99636c..3e8bb99 100755 --- a/lib/route.sh +++ b/lib/route.sh @@ -56,6 +56,15 @@ if [ "${devs_count}" -eq "0" ]; then return fi +flush() { + # see also: https://github.com/QSCTech/zjunet/issues/39 + ip route flush 10.5.1.5 + ip route flush 10.5.1.7 + ip route flush 10.5.1.9 +} + +flush + ip route replace 10.5.1.0/24 via $gateway # for LNS ip route replace 10.10.0.0/24 via $gateway # for DNS @@ -113,3 +122,4 @@ esac $cmd ip route +ip route diff --git a/lib/xl2tpd.sh b/lib/xl2tpd.sh index aa5458e..cabf566 100755 --- a/lib/xl2tpd.sh +++ b/lib/xl2tpd.sh @@ -123,7 +123,7 @@ connect() { prev_count=$(ip addr show | grep 'inet.*ppp' | grep ' 10.5.' | wc -l) - for i in $(seq 0 120); do + for i in $(seq 0 10000); do tail $PPP_LOG_FILE tail $PPP_LOG_FILE >> $LOG_FILE @@ -144,7 +144,6 @@ connect() { return fi - sleep 1 done echo "Fail to bring up ppp, timeout."