From 4d461aacca9b144ded709320de1652603f7f2458 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Sun, 11 Feb 2024 19:28:38 +0100 Subject: [PATCH] p910nd: init: check device (/dev/usb/lpX) existence this prevents the daemon exiting when a configured device is not plugged in. Signed-off-by: Paul Donald --- net/p910nd/files/p910nd.init | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/p910nd/files/p910nd.init b/net/p910nd/files/p910nd.init index 092a918ab0..a15e8d1dc7 100644 --- a/net/p910nd/files/p910nd.init +++ b/net/p910nd/files/p910nd.init @@ -32,7 +32,9 @@ start_service() { start_p910nd() { local section="$1" runas_root config_get_bool "enabled" "$section" "enabled" '0' - if [ "$enabled" -gt 0 ]; then + config_get device "$section" device + # If the device path exists, the device is connected; set it up: + if [ "$enabled" -gt 0 ] && [ -e "$device" ]; then args="-d " config_get port "$section" port append_bool "$section" bidirectional "-b" -- 2.30.2