1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 19:54:48 +08:00

flush after connecting vpn

This commit is contained in:
Zeno Zeng 2014-10-03 21:12:37 +08:00
parent 83170ffbf2
commit 426098f0ed
5 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
VERSION=0.1.0-18
VERSION=0.1.1-2
cd debian
./build.sh $VERSION > /dev/null

View File

@ -21,7 +21,7 @@ Version: $VERSION
Section: net
Priority: optional
Architecture: all
Depends: xl2tpd, curl
Depends: xl2tpd, libcurl
Maintainer: Zeno Zeng <zenoofzeng@gmail.com>
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/

View File

@ -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

View File

@ -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"

View File

@ -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 <<EOF