Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f998844 authored by Romain Hunault's avatar Romain Hunault
Browse files

Wait recovery for a specific devices

parent 0c9ac17f
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

# Parameter
# $1: DEVICES_LOCKED_PATH temp folder where are stored locked devices
# $2: DEVICE_ID ID of the device to wait

# Return
# - displayed: DEVICE_ID device detected
@@ -29,12 +30,24 @@
# - 101 : DEVICES_LOCKED_PATH missing

DEVICES_LOCKED_PATH=$1
DEVICE_ID=$2

if [ -z $DEVICES_LOCKED_PATH ]
then
  exit 101
fi

if [ ! -z $DEVICE_ID ]
then
  while true
  do
    adb devices | grep --perl-regex "${DEVICE_ID}\trecovery"
    if [ $? == 0 ]
    then
      exit 0
    fi
  done
fi

function newDevice
{