Created
December 11, 2018 07:34
-
-
Save kingcody/2f5d71a79d34f8c2c9607c95fe956380 to your computer and use it in GitHub Desktop.
Update teensyduino.sh PID Detection
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 | |
sleep 2 | |
export HOME=$2 | |
$1 & TEENSYPID=$! | |
sleep 5 | |
xdotool search --class "teensyduino" \ | |
windowfocus \ | |
key space sleep 1 \ | |
key Tab sleep 0.4 \ | |
key Tab sleep 0.4 \ | |
key Tab sleep 0.4 \ | |
key Tab sleep 0.4 \ | |
key space sleep 1 \ | |
key Tab sleep 0.4 \ | |
key Tab sleep 0.4 \ | |
key Tab sleep 0.4 \ | |
key Tab sleep 0.4 \ | |
key space sleep 1 \ | |
key Tab sleep 0.4 \ | |
key space sleep 35 | |
kill $TEENSYPID >/dev/null || exit 1 | |
[ -d $2/hardware/teensy ] || exit 1 |
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
--- teensyduino.sh 2018-09-23 07:13:17.000000000 -0400 | |
+++ teensyduino_pid.sh 2018-12-11 02:33:20.774271251 -0500 | |
@@ -3,7 +3,7 @@ | |
sleep 2 | |
export HOME=$2 | |
-$1 & | |
+$1 & TEENSYPID=$! | |
sleep 5 | |
xdotool search --class "teensyduino" \ | |
@@ -22,5 +22,5 @@ | |
key Tab sleep 0.4 \ | |
key space sleep 35 | |
-killall $(basename $1) >/dev/null || exit 1 | |
+kill $TEENSYPID >/dev/null || exit 1 | |
[ -d $2/hardware/teensy ] || exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment