From c4d7cea7ba8dddb3a2e6fbbc71053e55892dc4d1 Mon Sep 17 00:00:00 2001 From: poka Date: Sat, 21 Nov 2020 22:08:51 +0100 Subject: [PATCH] Import silkaj custom path --- .env.example | 1 + scripts/walletsBalance.sh | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index d569a11..be9d181 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ DUNITER="https://duniter-g1.p2p.legal" # Adresse du noeud Duniter qui sera scanné ESNODE="http://g1.data.duniter.fr" # Adresse du noeud ElasticSearch qui sera scanné (Si nécessaire) WEBPATH="/var/www/g1-stats" # Dossier qui sera créé si vous choisissez l'option web pour la mise en ligne des données (nécessite une configuration apache ou nginx) +SILKAJ="" # Chemin vers Silkaj (Récupéré automatiquement si non renseigné) diff --git a/scripts/walletsBalance.sh b/scripts/walletsBalance.sh index 91c1cc1..45942f7 100755 --- a/scripts/walletsBalance.sh +++ b/scripts/walletsBalance.sh @@ -7,13 +7,14 @@ source $GPATH/.env node=$(cut -d '/' -f3 <<<"$DUNITER") #Check if Silkaj is installed -[[ ! $(which silkaj) ]] && echo "Erreur: Vous devez installer Silkaj." && exit 1 +[[ -z $SILKAJ ]] && SILKAJ=$(which silkaj) +[[ -z $SILKAJ ]] && echo "Erreur: Vous devez installer Silkaj." && exit 1 rm -f silkaj_error.log work() { for i in $wallets; do exec() { - balance=$(silkaj -p $node balance $i 2>/dev/null) + balance=$($SILKAJ -p $node balance $i 2>/dev/null) } exec while [[ $? == 1 ]]; do echo "Erreur $k: $i" | tee -a silkaj_error.log; ((k++)); exec; done @@ -59,4 +60,4 @@ cp $GPATH/tpl/wallets_balance.html $WEBPATH/data/wallets_balance.html echo "$htmlBloc" > /tmp/solde_g1_html.txt printf '%s\n' '/_LINE/r /tmp/solde_g1_html.txt' 1 '/_LINE/d' w | ed $WEBPATH/data/wallets_balance.html > /dev/null -rm /tmp/solde_g1_html.txt \ No newline at end of file +rm /tmp/solde_g1_html.txt