Last active
February 14, 2024 11:03
-
-
Save jlp78/f103beb941842ee1c59fa8b24640684a to your computer and use it in GitHub Desktop.
This file contains 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
# from Aaron Toppence (eightyeight) https://ae7.st/p/734 | |
# updated to detect if TOR is not running | |
expandurl () { | |
(torsocks wget --spider -O - -S $1 2>&1 | | |
awk '/^Location/ {gsub("\\?utm_.*$",""); print $2; exit 0} | |
/socks5 libc connect: Connection refused/ {exit 1}') || | |
(echo "warning, TOR not enabled" | |
wget --spider -O - -S $1 2>&1 | | |
awk '/^Location/ {gsub("\\?utm_.*$",""); print $2; exit 0}') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment