Last active
February 14, 2025 02:49
-
-
Save geminixiang/946f4e3882b6cf3364cdc227ad50bc00 to your computer and use it in GitHub Desktop.
ip.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "內網 IP: $(ipconfig getifaddr en0)" | |
echo "外網 IP: $(curl -s ifconfig.me)" |
Fish shell
# 添加以下指令到 ~/.config/fish/config.fish,source ~/.config/fish/config.fish
alias myip="curl -fsSL https://gist.githubusercontent.com/geminixiang/946f4e3882b6cf3364cdc227ad50bc00/raw/a809b3ec5110e48aad58203c58c03e761781c28a/ip.sh | sh"
❯ myip
內網 IP: 192.168.0.101
外網 IP: 1.*.*.*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -fsSL https://gist.githubusercontent.com/geminixiang/946f4e3882b6cf3364cdc227ad50bc00/raw/a809b3ec5110e48aad58203c58c03e761781c28a/ip.sh | sh