From 868e492014553b323933ad64f976d8ee920ea2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 26 Dec 2023 00:16:02 +0100 Subject: [PATCH] Don't busyloop when fifo file is missing --- nix/pkgs/openwrt/usteer-stats.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nix/pkgs/openwrt/usteer-stats.sh b/nix/pkgs/openwrt/usteer-stats.sh index 1a26c43..6cbd7ce 100755 --- a/nix/pkgs/openwrt/usteer-stats.sh +++ b/nix/pkgs/openwrt/usteer-stats.sh @@ -6,6 +6,11 @@ INTERVAL=60 [ -p /tmp/usteer-info ] || mkfifo /tmp/usteer-info while true; do + if [ ! -p /tmp/usteer-info ]; then + echo "/tmp/usteer-info went missing!" + exit 1 + fi + DATA="$(cat /tmp/usteer-info)" cd /sys/class/net for iface in wlan*; do