aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-08-26 11:18:09 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-08-26 11:18:09 -0300
commit71938a3ef5751a2654458efd9e08ade72805adf1 (patch)
tree81f273a6629e3966c61efc1830d67dc922fd9187
parentc05ede23d2497d6c4e7723dd041599708f9dba4a (diff)
downloadtrashman-71938a3ef5751a2654458efd9e08ade72805adf1.tar.gz
trashman-71938a3ef5751a2654458efd9e08ade72805adf1.tar.bz2
Updates tor-browser
-rwxr-xr-xshare/hoarder/tor-browser/unix/linux/install35
1 files changed, 24 insertions, 11 deletions
diff --git a/share/hoarder/tor-browser/unix/linux/install b/share/hoarder/tor-browser/unix/linux/install
index f3a9a18..00e7f67 100755
--- a/share/hoarder/tor-browser/unix/linux/install
+++ b/share/hoarder/tor-browser/unix/linux/install
@@ -11,6 +11,7 @@ LIB="$2"
# Additional parameters
DIST="https://dist.torproject.org/torbrowser/"
WORK="`mktemp -d`" || exit 1
+ARCH="`uname -m`"
# Determine the application name
if echo $BASENAME | grep -q 'tor-browser-alpha'; then
@@ -19,6 +20,15 @@ else
APP="tor-browser"
fi
+# Determine architecture
+if [ "$ARCH" == "i386" ]; then
+ ARCH="linux32"
+elif [ "$ARCH" == "i686" ]; then
+ ARCH="linux32"
+elif [ "$ARCH" == "x86_64" ]; then
+ ARCH="linux64"
+fi
+
# Include basic functions
. $LIB/trashman/functions || exit 1
@@ -42,7 +52,7 @@ fi
# Build the URL and filename strings
URL="${DIST}/${VERSION}/"
-FILE="tor-browser-linux64-${VERSION}_ALL.tar.xz"
+FILE="tor-browser-${ARCH}-${VERSION}_ALL.tar.xz"
# Download
wget "$URL/$FILE" -O $WORK/$FILE || exit 1
@@ -57,17 +67,20 @@ rm -rf $WORK/.gnupg || exi
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
+mkdir -p $HOME/.local/share || exit 1
+cd $HOME/.local/share || exit 1
+rm -rf $APP || exit 1
+mv $WORK/tor-browser $APP/$ARCH || 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
+mkdir -p $HOME/.local/bin || exit 1
+cd $HOME/.local/bin || exit 1
+ln -sf $HOME/.local/share/$APP/${ARCH}/Browser/start-tor-browser $APP-${ARCH} || exit 1
+
+# Remove old symlink to the Tor Browser script
+rm -f $HOME/.local/bin/$APP
# Done
-trashman_installed_at $HOME/.local/share/$APP
-trashman_run_with $HOME/.local/bin/$APP
+trashman_installed_at $HOME/.local/share/$APP/$ARCH
+trashman_run_with $HOME/.local/bin/$APP-$ARCH