This commit is contained in:
Luk
2026-03-07 15:11:16 +08:00
parent d75c6b7d02
commit 4cf98bc2cc
3 changed files with 39 additions and 23 deletions

View File

@@ -1,4 +1,8 @@
echo Local IP: $(echo `hostname -I` | awk '{print $1;}')
if [ "$(uname)" = "Darwin" ]; then
echo Local IP: $(ifconfig en0 | grep "inet " | awk '{print $2}')
else
echo Local IP: $(echo `hostname -I` | awk '{print $1;}')
fi
echo Public IP: `curl -s ifconfig.me`
echo