summaryrefslogtreecommitdiffhomepage
path: root/once
diff options
context:
space:
mode:
Diffstat (limited to 'once')
-rwxr-xr-xonce/get_updates.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/once/get_updates.sh b/once/get_updates.sh
index 1d3b191..7e779db 100755
--- a/once/get_updates.sh
+++ b/once/get_updates.sh
@@ -9,6 +9,7 @@ mb_path="$PATH"
mb_script="$0"
mb_success=no
mb_obtain=no
+mb_state=true
mb_dlopt="${1:-}"
error_msg()
@@ -112,6 +113,8 @@ for tarball in ${mb_tarballs:-}; do
printf '\tcached signature: %s\n' $mb_localsig >&3
if [ $mb_localsig != $mb_remotesig ]; then
+ mb_state=false
+
printf '\tsignatures do not match, download needed.\n' >&3
if [ $mb_obtain = no ]; then
@@ -133,6 +136,8 @@ for tarball in ${mb_tarballs:-}; do
fi
fi
else
+ mb_state=false
+
printf '\t/updates/%s found, checking signatures...\n' $tarball >&3
if ! [ -f /updates/$tarball.sha256 ]; then
@@ -182,6 +187,15 @@ for tarball in ${mb_tarballs:-}; do
printf '\n' >&3
done
+# already up-to-date?
+if [ "${mb_dlopt}" = '--check-state' ]; then
+ if [ $mb_state = true ]; then
+ update_success
+ else
+ update_needed
+ fi
+fi
+
# status
touch /updates/update.pending