diff options
Diffstat (limited to 'share/hoarder/tor-browser/unix/linux/install')
-rwxr-xr-x | share/hoarder/tor-browser/unix/linux/install | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/share/hoarder/tor-browser/unix/linux/install b/share/hoarder/tor-browser/unix/linux/install new file mode 100755 index 0000000..6607e8d --- /dev/null +++ b/share/hoarder/tor-browser/unix/linux/install @@ -0,0 +1,49 @@ +#!/usr/bin/env sh +# +# Install Tor Browser +# + +# Parameters +SHARE="$1" +LIB="$2" + +# Include basic functions +. $LIB/trashman/functions || exit 1 + +# Requirements +trashman_require wget + +# Additional parameters +APP="tor-browser" +VERSION="12.5a7" +URL="https://www.torproject.org/dist/torbrowser/${VERSION}/" +FILE="tor-browser-linux64-${VERSION}_ALL.tar.xz" +WORK="`mktemp -d`" || exit 1 + +# Download +wget "$URL/$FILE" -O $WORK/$FILE || exit 1 +wget "$URL/$FILE.asc" -O $WORK/$FILE.asc || exit 1 + +# Verify +gpg --homedir $WORK/.gnupg --import $SHARE/$APP/unix/linux/files/$APP.asc || exit 1 +gpg --homedir $WORK/.gnupg --verify $WORK/$FILE.asc || exit 1 +rm -rf $WORK/.gnupg || exit 1 + +# Unpack +tar xvf $WORK/$FILE -C $WORK || exit 1 + +# Install +mkdir -p $HOME/.local/share || exit 1 +cd $HOME/.local/share || exit 1 +rm -rf $APP || exit 1 +mv $WORK/tor-browser $APP || exit 1 +rm -rf $WORK || exit 1 + +# Create symlink to scripts +mkdir -p $HOME/.local/bin || exit 1 +cd $HOME/.local/bin || exit 1 +ln -sf $HOME/.local/share/$APP/Browser/start-tor-browser $APP || exit 1 + +# Done +trashman_installed_at $HOME/.local/share/$APP +trashman_run_with $HOME/.local/bin/$APP |