Update getting private IP address method in mac

This commit is contained in:
cruizba 2024-03-27 20:10:00 +01:00
parent 4346181caa
commit 28866728c5

View File

@ -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"
}