@ -108,10 +108,10 @@ function eat()
return 1
return 1
fi
fi
adb start-server # Prevent unexpected starting server message from adb get-state in the next line
adb start-server # Prevent unexpected starting server message from adb get-state in the next line
if [ $( adb get-state) != device -a $( adb shell test -e /sbin/recovery 2> /dev/null; echo $? ) != 0 ] ; then
if [ $( adb get-state) != device -a $( adb shell 'test -e /sbin/recovery 2> /dev/null; echo $?' ) != 0 ] ; then
echo "No device is online. Waiting for one..."
echo "No device is online. Waiting for one..."
echo "Please connect USB and/or enable USB debugging"
echo "Please connect USB and/or enable USB debugging"
until [ $( adb get-state) = device -o $( adb shell test -e /sbin/recovery 2> /dev/null; echo $? ) = 0 ] ; do
until [ $( adb get-state) = device -o $( adb shell 'test -e /sbin/recovery 2> /dev/null; echo $?' ) = 0 ] ; do
sleep 1
sleep 1
done
done
echo "Device Found.."
echo "Device Found.."
@ -782,7 +782,7 @@ function repodiff() {
function _adb_connected {
function _adb_connected {
{
{
if [ [ " $( adb get-state) " = = device &&
if [ [ " $( adb get-state) " = = device &&
" $( adb shell test -e /sbin/recovery; echo $? ) " != 0 ] ]
" $( adb shell 'test -e /sbin/recovery; echo $?' ) " != 0 ] ]
then
then
return 0
return 0
fi
fi