summaryrefslogtreecommitdiff
path: root/git-maintenance/get.sh
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-07 16:16:59 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-07 16:16:59 -0800
commit8902f7a223c782e40c8869afed906712381f2519 (patch)
treeda8f0a7b8923e71cfcb67d058e68b0adcdde3b82 /git-maintenance/get.sh
parentcd4351906daaac3b77a2f5fe6b3a2f664e9b88b4 (diff)
downloadstandingwithresilience-8902f7a223c782e40c8869afed906712381f2519.tar.gz
standingwithresilience-8902f7a223c782e40c8869afed906712381f2519.zip
try to work around some bsvup issues
Diffstat (limited to 'git-maintenance/get.sh')
-rwxr-xr-xgit-maintenance/get.sh14
1 files changed, 10 insertions, 4 deletions
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)