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:
parent
83170ffbf2
commit
426098f0ed
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
VERSION=0.1.0-18
|
VERSION=0.1.1-2
|
||||||
|
|
||||||
cd debian
|
cd debian
|
||||||
./build.sh $VERSION > /dev/null
|
./build.sh $VERSION > /dev/null
|
||||||
|
|||||||
@ -21,7 +21,7 @@ Version: $VERSION
|
|||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: xl2tpd, curl
|
Depends: xl2tpd, libcurl
|
||||||
Maintainer: Zeno Zeng <zenoofzeng@gmail.com>
|
Maintainer: Zeno Zeng <zenoofzeng@gmail.com>
|
||||||
Description: Command Line Scripts for ZJU
|
Description: Command Line Scripts for ZJU
|
||||||
This script provides a VPN / WLAN / NEXTHOP for ZJUer.
|
This script provides a VPN / WLAN / NEXTHOP for ZJUer.
|
||||||
@ -29,7 +29,7 @@ EOF
|
|||||||
|
|
||||||
# dpkg-deb
|
# dpkg-deb
|
||||||
find ./debian -type d | xargs chmod 755
|
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
|
mv debian.deb zjunet_${VERSION}_all.opk
|
||||||
|
|
||||||
# remove debian/
|
# remove debian/
|
||||||
|
|||||||
@ -56,15 +56,6 @@ if [ "${devs_count}" -eq "0" ]; then
|
|||||||
return
|
return
|
||||||
fi
|
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.5.1.0/24 via $gateway # for LNS
|
||||||
ip route replace 10.10.0.0/24 via $gateway # for DNS
|
ip route replace 10.10.0.0/24 via $gateway # for DNS
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,14 @@
|
|||||||
|
|
||||||
BASEDIR=$(dirname $0)
|
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() {
|
disconnect() {
|
||||||
users=$("${BASEDIR}/user.sh" getall)
|
users=$("${BASEDIR}/user.sh" getall)
|
||||||
for username in $users; do
|
for username in $users; do
|
||||||
@ -40,6 +48,7 @@ connect() {
|
|||||||
password=$("${BASEDIR}/user.sh" getpwd $username)
|
password=$("${BASEDIR}/user.sh" getpwd $username)
|
||||||
echo "[INFO] Login using ${username}"
|
echo "[INFO] Login using ${username}"
|
||||||
"${BASEDIR}/xl2tpd.sh" connect $username $password
|
"${BASEDIR}/xl2tpd.sh" connect $username $password
|
||||||
|
flush
|
||||||
done
|
done
|
||||||
|
|
||||||
"${BASEDIR}/route.sh"
|
"${BASEDIR}/route.sh"
|
||||||
|
|||||||
@ -41,7 +41,7 @@ case "$1" in
|
|||||||
"${BASEDIR}/dns.sh"
|
"${BASEDIR}/dns.sh"
|
||||||
;;
|
;;
|
||||||
--version)
|
--version)
|
||||||
echo "zjunet version: zjunet-0.1.0"
|
echo "zjunet version: zjunet-0.1.1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user