Skip to content

Instantly share code, notes, and snippets.

@thefinn93
Last active December 21, 2015 06:38
Show Gist options
  • Save thefinn93/6265110 to your computer and use it in GitHub Desktop.
Save thefinn93/6265110 to your computer and use it in GitHub Desktop.
Tor Browser Bundle installer
#!/bin/bash
version=2.3.25-12-dev
locale=en-US
arch=$(uname -p)
url=https://www.torproject.org/dist/torbrowser/linux/tor-browser-gnu-linux-$arch-$version-$locale.tar.gz
icon=https://check.torproject.org/images/tor-on.png
## Some times the gnupg keyserver sucks, fall back to the ubuntu one
echo "Preparing to install the Tor Browser Bundle"
echo "First, gotta get The Tor Project's keys."
echo "Trying with keys.gnupg.net, or keys.ubuntu.com if that fails"
gpg --keyserver keys.gnupg.net --recv 63FEE659 || gpg --keyserver keyserver.ubuntu.com --recv 63FEE659 || echo "Fuck. Bailing out. Get 63FEE659 yourself"
if [ $? -ne 0 ]; then
exit
fi
cd ~/.local/
echo "Getting `basename $url`. This might take a second, depending on your network speed"
wget $url
echo "Getting it's signature..."
wget $url.asc
echo "Verifying it's signature..."
gpg --fingerprint 0x416F061063FEE659 --verify `basename $url.asc`
if [ $? -ne 0 ]; then
echo "Aw fuck. Someone is fuckin with your connection. I'd shut your computer off and go outsite."
exit;
fi
echo "Seems good. Untarin this bitch"
tar xzf `basename $url`
echo "Extracted. Installing menu icons"
mkdir -p ~/.local/share/applications
cat > ~/.local/share/applications/tor.desktop <<END
[Desktop Entry]
Encoding=UTF-8
Name=Tor Browser Bundle
Comment=Defend yourself against network surveillance and traffic analysis.
Exec=$HOME/.local/tor-browser_en-US/start-tor-browser %u
Terminal=false
Type=Application
Icon=torbrowser
Categories=Network;WebBrowser;
END
chmod +x ~/.local/share/applications/tor.desktop
mkdir -p ~/.local/share/icons/hicolor/128x128/apps
echo "Getting the icon..."
wget -O ~/.local/share/icons/hicolor/128x128/apps/torbrowser.png $icon
echo "And finally, cleaning up.."
rm -v `basename $url.asc` `basename $url`
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment