Created
January 19, 2017 16:22
-
-
Save mcatta/adcc5e7c20c9fabc44709d48e5321805 to your computer and use it in GitHub Desktop.
Bash script to check if usb device is connect via adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/bin/bash | |
#IP='1216.58.205.195' | |
function pingDevice { | |
#ping -c1 -t300 $IP 2>/dev/null 1>/dev/null | |
#if [ "$?" = 0 ] | |
if adb get-state 1>/dev/null 2>&1 | |
then | |
echo "Host found" | |
else | |
echo "Host not found" | |
fi | |
} | |
while [ 0 = 0 ]; do | |
pingDevice | |
sleep 5 | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe better add shebang line like:
#!/usr/bin/env bash