augment TeleDongle turn on script to support serial number on command line
authorBdale Garbee <bdale@gag.com>
Sun, 2 Oct 2016 23:19:14 +0000 (17:19 -0600)
committerBdale Garbee <bdale@gag.com>
Sun, 2 Oct 2016 23:19:14 +0000 (17:19 -0600)
ao-bringup/turnon_teledongle

index d17e2b9..0cdbde7 100755 (executable)
@@ -28,8 +28,21 @@ echo "\t$PRODUCT_NAME v$VERSION powered from USB"
 echo "\t\twith ST-Link-V2 cabled to debug header"
 echo "\t\twith coax from UHF to frequency counter"
 echo
-echo -n "$PRODUCT_NAME-$VERSION serial number: "
-read SERIAL
+
+case $# in
+    1)
+       SERIAL="$1"
+       echo "$PRODUCT-$VERSION serial number: $SERIAL" 
+       ;;
+    0)
+       echo -n "$PRODUCT-$VERSION serial number: "
+       read SERIAL
+       ;;
+    *)
+       echo "Usage: $0 <serial-number>" 1>&2
+       exit 1;
+       ;;
+esac
 
 BINARIES=$HOME/altusmetrumllc/Binaries