# 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:
# 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.
[[ $x != $f ]] || continue
command rm -f $x
done
-sudo ln -sf /a/opt/tor-browser_en-US/Browser/start-tor-browser /usr/local/bin