mirror of
https://github.com/leitbogioro/Tools.git
synced 2025-10-10 15:25:47 +08:00
Update InstallNET.sh
This commit is contained in:
parent
1a4388aa3b
commit
3bb22d4e36
1 changed files with 2 additions and 1 deletions
|
@ -434,7 +434,8 @@ fi
|
||||||
if [ "$setNet" == "0" ]; then
|
if [ "$setNet" == "0" ]; then
|
||||||
dependence ip
|
dependence ip
|
||||||
[ -n "$interface" ] || interface=`getInterface`
|
[ -n "$interface" ] || interface=`getInterface`
|
||||||
iAddr=`ip addr show dev $interface |grep "inet.*" |head -n1 |grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\/[0-9]\{1,2\}'`
|
# iAddr=`ip addr show dev $interface |grep "inet.*" |head -n1 |grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\/[0-9]\{1,2\}'`
|
||||||
|
iAddr=`ip addr show | grep -w "inet" | grep "scope" | grep "global" | awk -F " " '{for (i=2;i<=NF;i++)printf("%s ", $i);print ""}' | awk '{print$1}'`
|
||||||
ipAddr=`echo ${iAddr} |cut -d'/' -f1`
|
ipAddr=`echo ${iAddr} |cut -d'/' -f1`
|
||||||
ipMask=`netmask $(echo ${iAddr} |cut -d'/' -f2)`
|
ipMask=`netmask $(echo ${iAddr} |cut -d'/' -f2)`
|
||||||
# ipGate=`ip route show |grep "via" |grep "$interface" |grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' |head -n1`
|
# ipGate=`ip route show |grep "via" |grep "$interface" |grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' |head -n1`
|
||||||
|
|
Loading…
Add table
Reference in a new issue