Fix GVA request

This commit is contained in:
poka 2021-02-26 06:51:32 +01:00
parent f18a98f563
commit ba0f91404c
1 changed files with 12 additions and 20 deletions

View File

@ -12,30 +12,22 @@ node=$(cut -d '/' -f3 <<<"$DUNITER")
work() {
for i in $wallets; do
exec() {
jsonResult=$($JAKLIS idBalance -p $i 2>/dev/null)
}
exec
while [[ $? == 1 ]]; do echo "Erreur $k: $i"; ((k++)); exec; done
unset k
if [[ $1 == "members" ]]; then
exec() {
jsonResult=$($JAKLIS idBalance -p $i 2>/dev/null)
}
exec
while [[ $? == 1 ]]; do echo "Erreur $k: $i"; ((k++)); exec; done
unset k
balance=$(echo "$jsonResult" | jq -r '.balance')
username=$(echo "$jsonResult" | jq -r '.username')
formatedBalance=$(printf "%-10s | %-45s | %-1s" $balance $i $username)
balance=$(echo "$jsonResult" | jq -r '.balance')
username=$(echo "$jsonResult" | jq -r '.username')
formatedBalance=$(printf "%-10s | %-45s | %-1s" $balance $i $username)
htmlBloc="$htmlBloc"$'\n'"<tr><td>$balance</td><td>$i</td><td>$username</td></tr>"
if [[ $1 == "members" ]]; then
htmlBloc="$htmlBloc"$'\n'"<tr><td>$balance</td><td>$i</td><td><b>$username</b></td></tr>"
unset username
else
exec() {
balance=$($JAKLIS id -p $i 2>/dev/null)
}
exec
while [[ $? == 1 ]]; do echo "Erreur $k: $i"; ((k++)); exec; done
unset k
formatedBalance=$(printf "%-10s | %-45s" $balance $i)
htmlBloc="$htmlBloc"$'\n'"<tr><td>$balance</td><td>$i</td><td> </td></tr>"
htmlBloc="$htmlBloc"$'\n'"<tr><td>$balance</td><td>$i</td><td>$username</td></tr>"
fi
unset balance