[script][flash_all] Fix bash redirection

This commit is contained in:
Mathieu Maret 2016-03-17 14:45:30 +01:00
parent b4983a6a96
commit cfa51b983e

View File

@ -49,19 +49,19 @@ function check_fastboot_serial {
function reboot_and_wait_for_device { function reboot_and_wait_for_device {
check_forbidden_serial $1 check_forbidden_serial $1
adb -s $1 reboot bootloader; adb -s $1 reboot bootloader;
fastboot devices | grep $1 >/dev/null 2>1 fastboot devices | grep $1 >/dev/null 2>&1
while [ $? == 1 ]; do while [ $? == 1 ]; do
sleep 1; sleep 1;
echo "Waiting for $1 in fastboot mode..." echo "Waiting for $1 in fastboot mode..."
fastboot devices | grep $1 >/dev/null 2>1 fastboot devices | grep $1 >/dev/null 2>&1
done done
} }
function check_presence { function check_presence {
if $haveSerial ; then if $haveSerial ; then
fastboot devices | grep $serial >/dev/null 2>1 fastboot devices | grep $serial >/dev/null 2>&1
if [[ $? == 1 ]] ; then if [[ $? == 1 ]] ; then
adb devices | grep $serial >/dev/null 2>1 adb devices | grep $serial >/dev/null 2>&1
if [[ $? == 0 ]] ; then if [[ $? == 0 ]] ; then
reboot_and_wait_for_device $serial reboot_and_wait_for_device $serial
else else