mirror of
https://github.com/QSCTech/zjunet.git
synced 2026-01-22 19:54:48 +08:00
Flexible ZJUWLAN availabilty testing IP support & silent curl without noisy output
This commit is contained in:
parent
c78d8472c8
commit
a37f06b382
7
route.sh
7
route.sh
@ -97,13 +97,14 @@ for dev in $devs; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# WLAN
|
# WLAN
|
||||||
ip route replace 10.202.68.44 via ${gateway}
|
zjuwlan_test_ip=10.202.68.44
|
||||||
zjuwlan_status=`curl 10.202.68.44 | grep net.zju.edu.cn | wc -l`
|
ip route replace $zjuwlan_test_ip via ${gateway}
|
||||||
|
zjuwlan_status=`curl -s $zjuwlan_test_ip | grep net.zju.edu.cn | wc -l`
|
||||||
if [ $zjuwlan_status -gt 0 ]
|
if [ $zjuwlan_status -gt 0 ]
|
||||||
then
|
then
|
||||||
cmd="${cmd} nexthop via ${gateway}"
|
cmd="${cmd} nexthop via ${gateway}"
|
||||||
fi
|
fi
|
||||||
ip route del 10.202.68.44 || true
|
ip route del $zjuwlan_test_ip || true
|
||||||
$cmd
|
$cmd
|
||||||
ip route
|
ip route
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user