diff --git a/build/build.sh b/build/build.sh index 383d7c7..a99712f 100755 --- a/build/build.sh +++ b/build/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION=0.1.0-18 +VERSION=0.1.1-2 cd debian ./build.sh $VERSION > /dev/null diff --git a/build/openwrt/build.sh b/build/openwrt/build.sh index 1c7901d..0cc672a 100755 --- a/build/openwrt/build.sh +++ b/build/openwrt/build.sh @@ -21,7 +21,7 @@ Version: $VERSION Section: net Priority: optional Architecture: all -Depends: xl2tpd, curl +Depends: xl2tpd, libcurl Maintainer: Zeno Zeng Description: Command Line Scripts for ZJU This script provides a VPN / WLAN / NEXTHOP for ZJUer. @@ -29,7 +29,7 @@ EOF # dpkg-deb find ./debian -type d | xargs chmod 755 -dpkg-deb -Zgzip --build debian +dpkg-deb -Zgzip --build debian # for opkg mv debian.deb zjunet_${VERSION}_all.opk # remove debian/ diff --git a/lib/route.sh b/lib/route.sh index 3e8bb99..6fe24f5 100755 --- a/lib/route.sh +++ b/lib/route.sh @@ -56,15 +56,6 @@ 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 diff --git a/lib/vpn.sh b/lib/vpn.sh index 885ea04..7a3c9a1 100755 --- a/lib/vpn.sh +++ b/lib/vpn.sh @@ -23,6 +23,14 @@ BASEDIR=$(dirname $0) +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 + ip route flush 10.5.6.2 +} + disconnect() { users=$("${BASEDIR}/user.sh" getall) for username in $users; do @@ -40,6 +48,7 @@ connect() { password=$("${BASEDIR}/user.sh" getpwd $username) echo "[INFO] Login using ${username}" "${BASEDIR}/xl2tpd.sh" connect $username $password + flush done "${BASEDIR}/route.sh" diff --git a/lib/zjunet.sh b/lib/zjunet.sh index 623b047..d443722 100755 --- a/lib/zjunet.sh +++ b/lib/zjunet.sh @@ -41,7 +41,7 @@ case "$1" in "${BASEDIR}/dns.sh" ;; --version) - echo "zjunet version: zjunet-0.1.0" + echo "zjunet version: zjunet-0.1.1" ;; *) cat <