save the file check every time
This commit is contained in:
parent
1d95b2210e
commit
7ea15612b4
1 changed files with 1 additions and 2 deletions
|
@ -11,10 +11,9 @@ case "$BLOCK_BUTTON" in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
logfile="${XDG_CACHE_HOME:-$HOME/.cache}/netlog"
|
logfile="${XDG_CACHE_HOME:-$HOME/.cache}/netlog"
|
||||||
prevdata="$(cat "$logfile")"
|
prevdata="$(cat "$logfile")" || echo "0 0" > "$logfile"
|
||||||
|
|
||||||
rxcurrent="$(($(paste -d '+' /sys/class/net/[ew]*/statistics/rx_bytes)))"
|
rxcurrent="$(($(paste -d '+' /sys/class/net/[ew]*/statistics/rx_bytes)))"
|
||||||
[ -f "$logfile" ] || echo "0 0" > "$logfile"
|
|
||||||
txcurrent="$(($(paste -d '+' /sys/class/net/[^lo]*/statistics/tx_bytes)))"
|
txcurrent="$(($(paste -d '+' /sys/class/net/[^lo]*/statistics/tx_bytes)))"
|
||||||
|
|
||||||
printf "🔻%sKiB 🔺%sKiB\\n" \
|
printf "🔻%sKiB 🔺%sKiB\\n" \
|
||||||
|
|
Loading…
Reference in a new issue