-# don't check for updates on go more than once a day
-yesterday=$(( $(date +%s) - 60*60*24 ))
-if (( $(stat -c %Y FETCH_HEAD) < yesterday )); then
- m git fetch
+
+up=true
+install=false
+
+if ! $force; then
+ yesterday=$(( $(date +%s) - 60*60*24 ))
+ # no need to check for updates on go more than once a day
+ if (( $(stat -c %Y FETCH_HEAD) > yesterday )); then
+ up=false
+ fi
+
+ # update will get overwritten if we dont do it on central host.
+ if [[ -e /a/bin/bash_unpublished/source-state ]]; then
+ source /a/bin/bash_unpublished/source-state
+ if [[ $HOSTNAME != "$HOST2" ]]; then
+ up=false
+ fi
+ fi
+fi
+
+shopt -s nullglob
+
+f=$(
+ for f in go*.tar.gz; do
+ echo $f
+ done | sort -Vr | head -n1
+ )
+if [[ ! $f ]]; then
+ up=true
+fi
+
+if $up; then
+ m git fetch --tags