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

zjunet.sh

This commit is contained in:
Zeno Zeng 2014-09-18 22:45:38 +08:00
parent 182ac5ffce
commit 5a0a23ccc3
2 changed files with 32 additions and 1 deletions

4
dns.sh Normal file → Executable file
View File

@ -1,10 +1,12 @@
#!/bin/sh
##################################
#
# DNS Helper
#
##################################
function zju_test_and_set_up_dns() {
zju_test_and_set_up_dns () {
until [ -z "$1" ]
do
dig baidu.com @$1 +time=1 > /dev/null && echo "$1 ... ok" && echo "nameserver $1" > /etc/resolv.conf && break

29
zjunet.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
##################################
#
# Router
#
##################################
BASEDIR=$(dirname $0)
case "$1" in
config)
zju_config
;;
ip)
ip route show 0/0 | cut -d " " -f 3
;;
wlan)
# TODO
zju_connect_wlan
;;
vpn)
# if 10.189.xxx => is zjuwlan
# else set up route
;;
dns)
"$BASEDIR/dns.sh"
;;
esac