diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2023-08-14 12:55:43 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2023-08-14 12:55:43 -0300 |
commit | 3046a9825392ddb4e34c47cc2fb88275a21193f6 (patch) | |
tree | ebd66659f1ca0364e352984f0cc571ebb158894e /share/hoarder/tor-browser/unix | |
parent | 70a4c0e8ad67e93b05f8b87e4eb5261019d25acc (diff) | |
download | trashman-3046a9825392ddb4e34c47cc2fb88275a21193f6.tar.gz trashman-3046a9825392ddb4e34c47cc2fb88275a21193f6.tar.bz2 |
Fix: hoarder: merge tor-browser and torbrowser-alpha into a single script and autodetect the latest version
Diffstat (limited to 'share/hoarder/tor-browser/unix')
-rwxr-xr-x | share/hoarder/tor-browser/unix/linux/install | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/share/hoarder/tor-browser/unix/linux/install b/share/hoarder/tor-browser/unix/linux/install index 2577572..c8a0f7b 100755 --- a/share/hoarder/tor-browser/unix/linux/install +++ b/share/hoarder/tor-browser/unix/linux/install @@ -4,21 +4,45 @@ # # Parameters +BASENAME="$0" SHARE="$1" LIB="$2" +# Additional parameters +DIST="https://dist.torproject.org/torbrowser/" +WORK="`mktemp -d`" || exit 1 + +# Determine the application name +if echo $BASENAME | grep -q 'tor-browser-alpha'; then + APP="tor-browser-alpha" +else: + APP="tor-browser" +fi + # Include basic functions . $LIB/trashman/functions || exit 1 # Requirements -trashman_require wget +trashman_require wget lynx gpg tar xz -# Additional parameters -APP="tor-browser" -VERSION="12.5.2" -URL="https://www.torproject.org/dist/torbrowser/${VERSION}/" +# Determine the current version filter +if [ "$APP" = "tor-browser" ]; then + VERSION_FILTER="-v" +fi + +# Try to get the current version +# Use a large (10000) number for grep to make sure we get all available versions +VERSION="`LC_ALL=C lynx -dump https://dist.torproject.org/torbrowser/ 2> /dev/null | grep -A 10000 References | grep -e 'torbrowser' | grep -v '?' | sort -V | sed -e 's|^.*dist.torproject.org/torbrowser/||' -e 's|/||g' | grep $VERSION_FILTER a | tail -n 1`" + +# Check for available versions +if [ -z "$VERSION" ]; then + trashman_echo "error determining the available $APP version, aborting" + exit 1 +fi + +# Build the URL and filename strings +URL="${DIST}/${VERSION}/" FILE="tor-browser-linux64-${VERSION}_ALL.tar.xz" -WORK="`mktemp -d`" || exit 1 # Download wget "$URL/$FILE" -O $WORK/$FILE || exit 1 |