]> gitweb.fluxo.info Git - trashman.git/commitdiff
Updates tor-browser
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 26 Aug 2023 14:18:09 +0000 (11:18 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 26 Aug 2023 14:18:09 +0000 (11:18 -0300)
share/hoarder/tor-browser/unix/linux/install

index f3a9a186ff3e2290b9d6a30cc20af6f4897691c8..00e7f674f177c2494885b43c18d5b9750a65d4c6 100755 (executable)
@@ -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