summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
authorHekuran <62762955+narukeh@users.noreply.github.com>2020-05-30 17:27:01 +0200
committerGitHub <noreply@github.com>2020-05-30 17:27:01 +0200
commitdaf2829167571cec6b78a7a3abe511b90b40071d (patch)
tree3ead189b38b57b866e795f80dfc4ca4aa71ef09d /.local
parentd8272650bd675011496b4825160510109e47bba5 (diff)
downloadeibhear-daf2829167571cec6b78a7a3abe511b90b40071d.tar.gz
eibhear-daf2829167571cec6b78a7a3abe511b90b40071d.tar.zst
eibhear-daf2829167571cec6b78a7a3abe511b90b40071d.zip
create netlog if empty
it would not run without an existing nonempty log file
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/statusbar/nettraf1
1 files changed, 1 insertions, 0 deletions
diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf
index 82305c3..a3c9f6f 100755
--- a/.local/bin/statusbar/nettraf
+++ b/.local/bin/statusbar/nettraf
@@ -14,6 +14,7 @@ logfile="${XDG_CACHE_HOME:-$HOME/.cache}/netlog"
prevdata="$(cat "$logfile")"
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)))"
printf "🔻%sKiB 🔺%sKiB\\n" \