# https://dist.torproject.org/torbrowser/
ver=$(curl -s https://dist.torproject.org/torbrowser/ \
- | sed -rn 's/.*href="([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' \
+ | sed -rn 's/.*href="([0-9]+\.[0-9]+).*/\1/p' \
| sort -Vr | head -n 1)
cd /a/opt
f=tor-browser-linux64-${ver}_en-US.tar.xz
-timestamp=$(stat -c %Y $f)
+timestamp=$(stat -c %Y $f) ||:
wget -N https://www.torproject.org/dist/torbrowser/$ver/$f
-if [[ $timestamp == $(stat -c %Y $f) && -e /a/opt/tor-browser_en-US/Browser/start-tor-browser ]]; then
+new_timestamp=$(stat -c %Y $f) ||:
+if [[ $timestamp == $new_timestamp && -e /a/opt/tor-browser_en-US/Browser/start-tor-browser ]]; then
# already installed
exit 0
fi