diff --git a/sup b/sup index e80378c..212925d 100755 --- a/sup +++ b/sup @@ -167,6 +167,14 @@ sup.mktemp() { printf '%s\n' "${tmp_dir}/${tmp_file_name}" } +sup.get_my_ip() { + my_ip=$( curl -fsL https://zfh.so/ip ) + + if ! (( $? )); then + printf '%s\n' $my_ip + fi +} + sup.set_argv() { declare arg opt c declare -g argv @@ -219,6 +227,8 @@ main() { flag_scrot_fullscreen='1' ;; + -i|--my-ip) action='getmyip';; + -S|--short) flag_shortlink='1';; -u|--url) action='url';; @@ -236,6 +246,7 @@ main() { case "${action:-upload}" in upload) sup.upload "$1";; url) sup.url "$1";; + getmyip) sup.get_my_ip;; esac }