We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3e36c6 commit 95756cdCopy full SHA for 95756cd
static/ip.sh
@@ -6,7 +6,7 @@ INTERFACES="/etc/network/interfaces"
6
IFACE=$(lshw -c network | grep "logical name" | awk '{print $3}')
7
ADDRESS=$($IFCONFIG | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')
8
NETMASK=$($IFCONFIG | grep -w inet |grep -v 127.0.0.1| awk '{print $4}' | cut -d ":" -f 2)
9
-GATEWAY=$($IP route | awk '/\<default\>/ {print $3; exit}')
+GATEWAY=$(route -n|grep "UG"|grep -v "UGH"|cut -f 10 -d " ")
10
11
cat <<-IPCONFIG > "$INTERFACES"
12
auto lo $IFACE
0 commit comments