diff --git a/nbr-wallets.sh b/nbr-wallets.sh index 642b459..5d14963 100755 --- a/nbr-wallets.sh +++ b/nbr-wallets.sh @@ -2,6 +2,7 @@ ### Variable ### DUNITER="https://duniter-g1.p2p.legal" +indexhtml="index.html" ### echo "Initialisation ..." @@ -59,6 +60,19 @@ nbrSimpleWallets=$(echo "$nbrTotalWallets-$nbrMembers" | bc) pourcentMbrs=$(echo "scale=1; $nbrMembers*100/$nbrTotalWallets/1" | bc) pourcentWallets=$(echo "scale=1; $nbrSimpleWallets*100/$nbrTotalWallets/1" | bc) +web() { + cp stats.html $indexhtml + sed -i "s/_nbrTotalWallets/$nbrTotalWallets/g" $indexhtml + sed -i "s/_nbrSimpleWallets/$nbrSimpleWallets/g" $indexhtml + sed -i "s/_nbrMembers/$nbrMembers/g" $indexhtml + sed -i "s/_pourcentMbrs/$pourcentMbrs/g" $indexhtml + sed -i "s/_pourcentWallets/$pourcentWallets/g" $indexhtml + + chown www-data:www-data $indexhtml 2>/dev/null +} + +[[ $1 == "web" ]] && web + echo -e "\n ---" echo "Nombre total de wallet: $nbrTotalWallets" echo "Nombre de membres: $nbrMembers (${pourcentMbrs}%)" diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..1a13165 --- /dev/null +++ b/stats.html @@ -0,0 +1,7 @@ + +Nombre total de wallet: _nbrTotalWallets +Nombre de membres: _nbrMembers _pourcentMbrs% +Nombre de simple portefeuille: _nbrSimpleWallets _pourcentWallets% + + +