This commit is contained in:
fred 2022-04-20 19:22:48 +02:00
parent 1affa43677
commit 3bfc2cf563
1 changed files with 5 additions and 4 deletions

View File

@ -158,7 +158,7 @@ echo "##########################################################################
# get latest history.json publishes with (shared?) 'qo-op' IPNS key
if [[ "$(cat ~/.zen/bunkerbox/choice 2>/dev/null)" == "qo-op" ]]; then
[[ $(cat ~/.zen/bunkerbox/history_qo-op.json | jq .Videos[].link | grep $VUID) ]] && echo "VIDEO DEJA DANS LE CACHE... CONTINUE" && continue
IPNS="$(ipfs key list -l | grep 'qo-op' | cut -f 1 -d ' ')"
IPNS="$(ipfs key list -l | grep -w 'qo-op' | cut -f 1 -d ' ')"
IPNSL="/ipns/$IPNS"
ipfs get -o ~/.zen/bunkerbox/history_qo-op.json $IPNSL/history.json # Get actual IPNS qo-op history.json
# Missing file... reseting
@ -166,7 +166,8 @@ echo "##########################################################################
[[ $(cat ~/.zen/bunkerbox/history_qo-op.json | jq .Videos[].link | grep $VUID) ]] && echo "VIDEO DEJA DANS LE RESEAU... CONTINUE" && echo && cp ~/.zen/bunkerbox/history_qo-op.json ~/.zen/bunkerbox/history.json && continue
# JSON FUSION
jq -s '.[0] * .[1]' ~/.zen/bunkerbox/history_qo-op.json ~/.zen/bunkerbox/history.json | jq -M '.Videos |= unique_by(.link)' > ~/.zen/bunkerbox/history.fusion.json
mv ~/.zen/bunkerbox/history.fusion.json ~/.zen/bunkerbox/history.json ## REPLACE LOCAL HISTORY CACHE
mv ~/.zen/bunkerbox/history.fusion.json ~/.zen/bunkerbox/history.json
echo "## FUSIONNING 'qo-op' HISTORIES"
else
IPNS="."
IPNSL="./"
@ -242,7 +243,7 @@ echo "##########################################################################
mkdir -p ~/.zen/bunkerbox/homepage/${CHANNEL}/
mkdir -p ~/.zen/bunkerbox/channels/${CHANNEL}/
# New tiddlywiki with moa key
if [[ ! $(ipfs key list | grep qo-op_${CHANNEL}) ]]; then
if [[ ! $(ipfs key list | grep -w qo-op_${CHANNEL}) ]]; then
channelfilename=$(${MY_PATH}/tools/give_me_keystore_filename.py qo-op_${CHANNEL})
# (Re)Creating IPNS Key & TiddlyWiki for channel
ipfs key rm qo-op_${CHANNEL}
@ -261,7 +262,7 @@ echo "##########################################################################
echo $channelkey > ~/.zen/bunkerbox/channels/${CHANNEL}/channelkey
else
echo "$CHANNEL IS UP. KEY IS CREATED. WAITING FOR SYNCING. PRINTING KNOWN MOA KEY."
ipfs key list -l | grep "qo-op_${CHANNEL}"
ipfs key list -l | grep -w "qo-op_${CHANNEL}"
fi
fi
######################### ######################### #########################