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

vpn disconnect

This commit is contained in:
Zeno Zeng 2014-09-21 23:03:24 +08:00
parent b5db28c519
commit a4a330ba59
2 changed files with 10 additions and 5 deletions

13
vpn.sh
View File

@ -21,10 +21,6 @@
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
disconnect() {
echo 'disconnect'
}
set_up_routes() {
IP=$(ip route show 0/0 | cut -d " " -f 3)
@ -66,6 +62,15 @@ connect() {
set_up_routes
}
disconnect() {
users=$("${BASEDIR}/user.sh" getall)
for username in $users; do
echo "Logout: ${username}"
"${BASEDIR}/xl2tpd.sh" disconnect $username
done
set_up_routes
}
#####################################
#

View File

@ -31,7 +31,7 @@ case "$1" in
"${BASEDIR}/wlan.sh" $2
;;
vpn)
"${BASEDIR}/vpn.sh" $2
sudo "${BASEDIR}/vpn.sh" $2
;;
dns)
"${BASEDIR}/dns.sh"