Move debug db files to debug db folder

This commit is contained in:
poka 2020-09-24 01:04:11 +02:00
parent 97308f601e
commit 7a4b368786
1 changed files with 6 additions and 6 deletions

View File

@ -23,22 +23,22 @@ echo -e "\n############# $day à $startTime #############\n"
[[ -z $(which jq) || -z $(which bc) || -z $(which curl) ]] && sudo apt update && sudo apt install jq bc curl
echo "Initialisation ..."
if $debug; then
TXBLOCKS=$(cat $SCRIPTPATH/db/txblocs)
membresPubkeys=$(cat db/membresPubkeys)
udBlocs=$(cat db/udblocs)
TXBLOCKS=$(cat $SCRIPTPATH/db/debug/txblocs)
membresPubkeys=$(cat $SCRIPTPATH/db/debug/membresPubkeys)
udBlocs=$(cat $SCRIPTPATH/db/debug/udblocs)
else
TXBLOCKS=$(curl -s ${DUNITER}/blockchain/with/tx | jq '.result.blocks[]')
echo "TXBLOCKS OK"
membresPubkeys=$(curl -s ${DUNITER}/wot/members | jq -r '.results[].pubkey')
echo "membresPubkeys OK"
udBlocs=$(curl -s ${DUNITER}/blockchain/with/ud | jq '.result.blocks[]')
echo "udBlocs OK"
fi
TXBLOCKS=($(echo "$TXBLOCKS" | sort -hu | awk '{printf $1" "}'))
unset 'TXBLOCKS[${#TXBLOCKS[@]}-1]'
echo "TXBLOCKS OK"
echo "membresPubkeys OK"
nbrMembers=$(echo "$membresPubkeys" | wc -l)
lastBloc=${TXBLOCKS[-1]}
echo "udBlocs OK"
isWeb=$1
jsonFile="$SCRIPTPATH/db/daily.json"