Skip to content

Commit

Permalink
Add uptime log info
Browse files Browse the repository at this point in the history
Print a log line with uptime
  • Loading branch information
casse-boubou committed Nov 13, 2022
1 parent f2e4555 commit 2e41c5d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions p2pool/rootfs/etc/services.d/status_commande/run
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ function calcul_uncles_stratum {
echo $oncles_stratum > /tmp/variables/oncles.txt
}

# Get uptime
staring_time=$(date +%s)
function calcul_time {
starting_from=$(( $(date +%s) - $staring_time ))
printf $(date -d@$starting_from -u +%H:%M:%S)
}



# --- Wait for p2pool is running ---
Expand Down Expand Up @@ -117,6 +124,7 @@ while pidof -q p2pool; do
cpt=0
while ((cpt<7200)); do
bashio::log.info "StratumServer status"
echo "P2PServer Uptime $(calcul_time)"
if test -f "/tmp/local/stats"; then
echo "Hashrate (15m est) = $(to_float '.hashrate_15m' /tmp/local/stats 1000 3) KH/s"
echo "Hashrate (1h est) = $(to_float '.hashrate_1h' /tmp/local/stats 1000 3) KH/s"
Expand Down

0 comments on commit 2e41c5d

Please sign in to comment.