Add -c option to myip script
This commit is contained in:
parent
570b8a5b5e
commit
e593efc410
13
script/myip
13
script/myip
|
@ -3,4 +3,15 @@
|
||||||
# Print public IP address
|
# Print public IP address
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
curl -s 'https://api.ipify.org?format=text'
|
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue