summaryrefslogtreecommitdiffstats
path: root/ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh')
-rwxr-xr-xansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh b/ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh
new file mode 100755
index 0000000..9262f97
--- /dev/null
+++ b/ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -ex
+uhubctl -p 123456 -a 0
+# give a lot of time to discharge capacitors on the board
+sleep 20
+uhubctl -p 123456 -a 1
+attempts=30
+while [ "x$(uhubctl | grep -e 05c6 -e 1199 -c)" != "x{{ gsm_modems }}" ]; do
+ attempts=$(($attempts - 1))
+ if [ "$attempts" -le 0 ]; then
+ echo "Timeout"
+ exit 1
+ fi
+ sleep 1
+done
+uhubctl