From 963cf32f6283f52f647ab2b9994d1a8e2ecbda4f Mon Sep 17 00:00:00 2001 From: paukstelis Date: Fri, 28 Jan 2022 18:15:29 -0500 Subject: [PATCH] fail state on detection --- addnew_printer.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addnew_printer.sh b/addnew_printer.sh index a119863..0a8d21a 100755 --- a/addnew_printer.sh +++ b/addnew_printer.sh @@ -159,7 +159,13 @@ new_instance () { echo "OK. Restart when you are ready" | log; exit 0 fi + #Failed state. Nothing detected + if [ -z "$UDEV" && -z "$TEMPUSB"]; then + echo "Not printer was detected during the detection period. Check your USB cable and try again." + main_menu + fi + #No serial number if [ -z "$UDEV" ]; then echo "Printer Serial Number not detected" prompt_confirm "Do you want to use the physical USB port to assign the udev entry? If you use this any USB hubs and printers detected this way must stay plugged into the same USB positions on your machine as they are right now" || exit 0