From f1f33ae197972ab15d676d51685a70c6e10686b8 Mon Sep 17 00:00:00 2001 From: Ivo Capanema Date: Wed, 9 Nov 2022 20:35:20 -0300 Subject: [PATCH] added adb serial found check --- reinstall-magisk-on-lineageos | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reinstall-magisk-on-lineageos b/reinstall-magisk-on-lineageos index d26d02a..a75f703 100755 --- a/reinstall-magisk-on-lineageos +++ b/reinstall-magisk-on-lineageos @@ -5,6 +5,10 @@ set -e PHONE_ADB_SERIAL_NUMBER=${ADB_DEVICE} # The adb serial number can be found by running `adb devices`. if [$PHONE_ADB_SERIAL_NUMBER = '']; then PHONE_ADB_SERIAL_NUMBER=$(echo $(adb devices) | sed -rn 's/(^|(.* ))([^ ]*) device(( .*)|$)/\3/; T; p; q') + if [[ -n $PHONE_ADB_SERIAL_NUMBER ]] + print_message "ERROR: no suitable phone connected" + exit 1 + fi fi print_message() {