From 3b9082807913ff761f1a51f5c220422e039bd3f2 Mon Sep 17 00:00:00 2001 From: Brett Kuskie Date: Fri, 14 Jun 2024 13:53:10 -0600 Subject: [PATCH] Update Tor Browser --- scripts/install_torbrowser.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/install_torbrowser.sh b/scripts/install_torbrowser.sh index e4dcc44..0f2a15b 100755 --- a/scripts/install_torbrowser.sh +++ b/scripts/install_torbrowser.sh @@ -10,8 +10,18 @@ export DEBIAN_FRONTEND="noninteractive" apt-get update apt-get install -y file gnupg2 libasound2 libgtk-3-0 libdbus-glib-1-2 wget xz-utils -TORPKG=`curl -s https://www.torproject.org/download/ 2>/dev/null | grep 'Download for Linux' | tr '"' '\n' | grep linux-x86_64` -TORSIG=`curl -s https://www.torproject.org/download/ 2>/dev/null | grep Signature | tr '"' '\n' | grep tar.xz.asc` +TORPKG=`curl -s https://www.torproject.org/download/ 2>/dev/null | grep 'Download for Linux' | tr '"' '\n' | grep linux-x86_64 || true` +TORSIG=`curl -s https://www.torproject.org/download/ 2>/dev/null | grep Signature | tr '"' '\n' | grep tar.xz.asc || true` + +if [ -z "${TORPKG}" ]; then + echo "Hyperlinks have changed! TORPKG is not valid!" + exit 1 +fi + +if [ -z "${TORSIG}" ]; then + echo "Hyperlinks have changed! TORSIG is not valid!" + exit 2 +fi # Download package wget https://www.torproject.org/${TORPKG} -O /tmp/tor.tar.xz @@ -23,7 +33,7 @@ gpg --verify /tmp/tor.tar.xz.asc /tmp/tor.tar.xz tar xf /tmp/tor.tar.xz -C /opt if [ ! -d /opt/tor-browser ]; then echo "tor-browser not found under /tmp/tor.tar.xz!" - exit 1 + exit 3 fi # Tweak package