From 9a189b377dab14748708de71dcabd7fa5bfd9f82 Mon Sep 17 00:00:00 2001 From: LukeZGD Date: Tue, 20 Jul 2021 13:30:19 +0800 Subject: [PATCH] Update device.sh --- resources/device.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/device.sh b/resources/device.sh index e6dda53..f928c2b 100755 --- a/resources/device.sh +++ b/resources/device.sh @@ -10,7 +10,8 @@ FindDevice() { Log "Finding device in $1 mode..." while (( $i < $Timeout )); do - [[ $($irecovery -q 2>/dev/null | grep -w "MODE" | cut -c 7-) == "$1" ]] && DeviceIn=1 + [[ $platform == "linux" ]] && DeviceIn=$(lsusb | grep -c $USB) + [[ $platform == "macos" && $($irecovery -q 2>/dev/null | grep -w "MODE" | cut -c 7-) == "$1" ]] && DeviceIn=1 if [[ $DeviceIn == 1 ]]; then Log "Found device in $1 mode." DeviceState="$1"