mirror of
https://github.com/openwrt/packages.git
synced 2026-01-11 04:04:50 +00:00
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 <newtwen@gmail.com>
(cherry picked from commit dabeaa7643)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user