Update getting private IP address method in mac
This commit is contained in:
parent
4346181caa
commit
28866728c5
@ -1,7 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
getPrivateIp() {
|
||||
ip=$(ipconfig getifaddr $(route -n get default | grep interface | awk '{print $2}'))
|
||||
interface=$(route -n get default | grep interface | awk '{print $2}')
|
||||
ip=$(ipconfig getifaddr "$interface")
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user