~/.zen /home/$YOU

This commit is contained in:
qo-op 2020-05-11 06:53:41 +02:00
parent 77d59c281e
commit a07334d544
1 changed files with 5 additions and 5 deletions

View File

@ -80,13 +80,13 @@ export DUNITER="https://g1.duniter.org"
export CESIUM="https://g1.data.le-sou.org"
##################################################################
# DU has a G1 value changed every 6 month!
# "~/.zen/_DU" removed every 6 month for refresh
if [[ -f ~/.zen/_DU ]]; then
export DUFACTOR=$(bc <<< "scale=2; $(cat ~/.zen/_DU) / 100")
# "/home/$YOU/.zen/_DU" removed every 6 month for refresh
if [[ -f /home/$YOU/.zen/_DU ]]; then
export DUFACTOR=$(bc <<< "scale=2; $(cat /home/$YOU/.zen/_DU) / 100")
else
LASTDU=$(curl -s ${DUNITER}/blockchain/with/ud | jq '.result.blocks[]' | tail -n 1) || exit 1
[[ $LASTDU != "" ]] && curl -s ${DUNITER}/blockchain/block/${LASTDU} | jq -r '.dividend' > ~/.zen/_DU || exit 1
export DUFACTOR=$(bc <<< "scale=2; $(cat ~/.zen/_DU) / 100")
[[ $LASTDU != "" ]] && curl -s ${DUNITER}/blockchain/block/${LASTDU} | jq -r '.dividend' > /home/$YOU/.zen/_DU || exit 1
export DUFACTOR=$(bc <<< "scale=2; $(cat /home/$YOU/.zen/_DU) / 100")
fi
# TODO Use latest Silkaj from "sudo fredp3 install silkaj"