18 lines
250 B
Plaintext
Raw Normal View History

2021-04-03 11:08:41 +02:00
#!/usr/bin/env bash
#
# Print public IP address
set -e
2021-04-22 11:42:02 +02:00
url='https://api.ipify.org?format=text'
if [ "$1" = "-c" ]; then
if [ $(uname -s) = "Darwin" ]; then
curl -s $url | pbcopy
else
curl -s $url | xclip -i
fi
else
curl -s $url
fi