From 8902f7a223c782e40c8869afed906712381f2519 Mon Sep 17 00:00:00 2001 From: olpc user Date: Tue, 7 Jan 2020 16:16:59 -0800 Subject: try to work around some bsvup issues --- git-maintenance/get.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'git-maintenance/get.sh') diff --git a/git-maintenance/get.sh b/git-maintenance/get.sh index f05d388..4af9fb0 100755 --- a/git-maintenance/get.sh +++ b/git-maintenance/get.sh @@ -4,7 +4,11 @@ PASS="$(ls "/run/media/"*/*"/key.fsojp.aes256" | head -n 1)" PUBKEY=1KwpZECcrGWnM3AFVSbv3Xr5qguV4yG2sV URLPFX="https://bico.media/$PUBKEY" -REPONAME=for-slow-organization-job-private +REPONAME="$1" +if [ "$REPONAME" = "" ] +then + REPONAME=for-slow-organization-job-private +fi echo "" echo "This script is expected to be kept in sync with:" @@ -14,15 +18,17 @@ echo "" # 2. mkdir -p .git/encrypted and git init mkdir -p "$REPONAME" cd "$REPONAME" -git init +if ! [ -d ".git" ]; then git init; fi -# prevent recreation of existing data on same medium-part +# prevent recreation of existing data git config gc.auto 0 mkdir -p .git/encrypted +mkdir -p .git/objects/pack.bak +mv .git/objects/pack/* .git/objects/pack.bak/ # 3. download .git/encrypted with wget -wget "$URLPFX"/refs.aes -O .git/encrypted/refs.aes +curl -sfI "$URLPFX"/refs.aes>/dev/null && wget "$URLPFX"/refs.aes -O .git/encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE ====" openssl aes-256-cbc -salt -pbkdf2 -pass "file:$PASS" -d -in .git/encrypted/refs.aes | tar -zxvf - for encpack in $(<.git/encrypted/list.txt) -- cgit v1.2.3