From 255f8d488848719de303f3fc4614e419c2aaecd7 Mon Sep 17 00:00:00 2001 From: olpc user Date: Fri, 10 Jan 2020 08:40:10 -0800 Subject: store script improvements --- git-maintenance/store.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'git-maintenance') diff --git a/git-maintenance/store.sh b/git-maintenance/store.sh index 435657a..f40dfb7 100755 --- a/git-maintenance/store.sh +++ b/git-maintenance/store.sh @@ -18,6 +18,11 @@ if ! curl -sfI "$URLPFX"/refs.aes>/dev/null; then echo "== Remember to get on internet. ==" echo echo "The wifi password for El Capitan hotel in San Francisco, CA is 84798." + echo "The front desk clerk usually opens the front door when the buzzer is rung." + echo + echo "Karl Semich started a bash/node script to log in automatically, in the" + echo "internet-access subfolder. Please replace if redone better." + echo exit 2 fi @@ -65,17 +70,17 @@ do if [ -e encrypted/"$fn" ] then echo "$fn ALREADY EXISTS LOCALLY ($packfile)" + if [ "$(cat "$packfile" | sha256sum)" = "$(decrypt < encrypted/"$fn" | $TAR -xvOf - "$packfile" | sha256sum)" ] + then + echo "$fn MATCHES CONTENT LOCALLY ($packfile)" + else + echo "$fn DOESN'T MATCH LOCAL CONTENT ($packfile)" + encrypt < "$tmpfile" > "$tmpfile".aes + mv "$tmpfile".aes encrypted/"$fn" + fi else echo "$fn IS NEW LOCALLY ($packfile)" fi - if [ "$(cat "$packfile" | sha256sum)" = "$(decrypt < encrypted/"$fn" | $TAR -xvOf - "$packfile" | sha256sum)" ] - then - echo "$fn MATCHES CONTENT LOCALLY ($packfile)" - else - echo "$fn DOESN'T MATCH LOCAL CONTENT ($packfile)" - encrypt < "$tmpfile" > "$tmpfile".aes - mv "$tmpfile".aes encrypted/"$fn" - fi # need to decrypt to compare content. if [ "$(curl "$URLPFX"/"$fn" | decrypt | $TAR -xvOf - "$packfile" | sha256sum)" = "$(cat "$packfile" | sha256sum)" ]; then echo "$fn MATCHES DOWNLOAD CONTENT ($packfile)" -- cgit v1.2.3