diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2020-01-07 18:32:45 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2020-01-07 18:32:45 -0800 |
commit | c034306d75dc64c08f9e09242ac1b77a4b561a85 (patch) | |
tree | 6ed445cd85eb93542cc9238a76c2eace64e64cfa /git-maintenance | |
parent | c83c8260ad1ca5e418f70dacdb39bd396f71ea21 (diff) | |
download | standingwithresilience-c034306d75dc64c08f9e09242ac1b77a4b561a85.tar.gz standingwithresilience-c034306d75dc64c08f9e09242ac1b77a4b561a85.zip |
bugfixes in get
Diffstat (limited to 'git-maintenance')
-rwxr-xr-x | git-maintenance/get.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/git-maintenance/get.sh b/git-maintenance/get.sh index 7bff0ab..e131f18 100755 --- a/git-maintenance/get.sh +++ b/git-maintenance/get.sh @@ -2,6 +2,7 @@ PASS="$(ls "/run/media/"*/*"/key.fsojp.aes256" | head -n 1)" PUBKEY=1KwpZECcrGWnM3AFVSbv3Xr5qguV4yG2sV +NONCE="$(date +%s)" URLPFX="https://bico.media/$PUBKEY" if [ "$1" != "" ] @@ -32,17 +33,18 @@ git config gc.auto 0 pushd .git # prevent recreation of existing data mkdir -p encrypted -mkdir -p objects/pack.bak -mv -f objects/pack/* objects/pack.bak/ +mkdir -p bak +cp -va HEAD refs objects/pack bak +rm objects/pack/* # 3. download .git/encrypted with wget -curl -sfI "$URLPFX"/refs.aes>/dev/null && wget "$URLPFX"/refs.aes -O encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ====" +curl -sfI "$URLPFX"/refs.aes?"$NONCE">/dev/null && wget "$URLPFX"/refs.aes?"$NONCE" -O encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ====" openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in encrypted/refs.aes | tar -Jxvf - for encpack in $(<encrypted/list.txt) do - wget "$URLPFX"/"$encpack" -O .git/encrypted/"$encpack" - openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in .git/encrypted/"$encpack" | tar -Jxvf - + wget "$URLPFX"/"$encpack" -O encrypted/"$encpack" + openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in encrypted/"$encpack" | tar -Jxvf - done for pack in objects/pack/*.pack |