X-Git-Url: https://iankelling.org/git/?p=buildscripts;a=blobdiff_plain;f=tor-browser;fp=tor-browser;h=9b3212cbc7330e7081bb9319f37894e3a5d38e25;hp=df4dd8c4533093799d790b21147a57f674071a0d;hb=6d5364acaf732814110b7ab98ef1d266276f64ee;hpb=f22fdf4a151ff0dcbbf1902977559eebe18613ea diff --git a/tor-browser b/tor-browser index df4dd8c..9b3212c 100755 --- a/tor-browser +++ b/tor-browser @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi +if [[ -s ~/.bashrc ]]; then . ~/.bashrc; fi # stable version is shown on: @@ -24,11 +24,16 @@ if [[ -s ~/.bashrc ]];then . ~/.bashrc;fi # we exclude verions with letters, as that seems to # be a relatively reliable indication of alpha/beta releases. -vers=($(curl -s https://dist.torproject.org/torbrowser/ \ - | sed -rn 's#.*href="([0-9]+\.[0-9]+[.0-9]*)/.*#\1#p' \ - | sort -Vr)) - - +# Their server has failed a few times on me, so do some retrying. +for (( i=0; i <= 6 ; i++ )); do + c=$(curl -s https://dist.torproject.org/torbrowser/) && break + sleep 15 +done +if [[ ! $c ]]; then + echo "$0: error: failed to curl tor directory listing" >&2 + exit 1 +fi +vers=($(printf "%s\n" "$c" | sed -rn 's#.*href="([0-9]+\.[0-9]+[.0-9]*)/.*#\1#p' | sort -Vr)) # by default it has perms for just 1 non-root user, which is ok for now.