diff --git a/user.sh b/user.sh index 46c44c6..1e3cdea 100755 --- a/user.sh +++ b/user.sh @@ -80,4 +80,7 @@ case "$1" in USERNAME=$2 cat "$DIR/${USERNAME}" ;; + *) + ${BASEDIR}/zjunet.sh usage + ;; esac diff --git a/vpn.sh b/vpn.sh index efd0b93..bba203f 100755 --- a/vpn.sh +++ b/vpn.sh @@ -41,7 +41,16 @@ set_up_routes() { esac # set up routes here - # todo + + GW=$(ip route get $VPN_SERVER 2>/dev/null | grep via | awk '{print $3}') + PPP=$(ip addr show | grep ppp[0-9]: | cut "-d " -f2 | cut -d: -f1) + echo "[MSG] Detected gateway: $GW, PPP device: $PPP ." + + ip route add 10.0.0.0/8 via $GW + ip route add 0.0.0.0/1 dev $PPP + ip route add 128.0.0.0/1 dev $PPP + + # todo nexthop } connect() { diff --git a/wlan.sh b/wlan.sh index b0d07aa..1154d43 100755 --- a/wlan.sh +++ b/wlan.sh @@ -76,9 +76,6 @@ case "$1" in logout $USERNAME $PASSWORD ;; *) - echo "Usage: " - echo " zjunet wlan login" - echo " zjunet wlan logout" + ${BASEDIR}/zjunet.sh usage ;; esac - diff --git a/zjunet.sh b/zjunet.sh index c269b91..d0c8ccf 100755 --- a/zjunet.sh +++ b/zjunet.sh @@ -36,4 +36,18 @@ case "$1" in dns) "${BASEDIR}/dns.sh" ;; + *) + cat <