summaryrefslogtreecommitdiffstats
path: root/ansible/roles/gsm-tester/templates/quad_modem_power_cycle.sh
blob: 626a04e5b7944fc5dc2903c59cb32815307a5e7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
set -ex
uhubctl -p 123456 -a 0 -n 1d50:4002
# give a lot of time to discharge capacitors on the board
sleep 20
uhubctl -p 123456 -a 1 -n 1d50:4002
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