1
0
Fork 0

script to flash the switch

This commit is contained in:
Maurice Debray 2026-01-24 00:31:26 +01:00
parent ee1c2f6788
commit 761105d337
4 changed files with 45 additions and 0 deletions

23
flash.sh Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
if ! curl -s -f http://127.0.0.1:8080/config.txt > /dev/null; then
echo "!!!!!!!!!!!!! please start server"
exit 1
fi
SSH_OPTS="-o StrictHostKeyChecking=no"
ssh $SSH_OPTS root@192.168.42.6 "cli request system zeroize"
echo "sleeping for 80s, then ping until up"
sleep 80
while true;
do
if ping -w 1 -c 1 192.168.42.6 > /dev/null; then
break
fi
done
echo "finished"

1
serve.sh Executable file
View file

@ -0,0 +1 @@
python -m http.server 8080 -d ./serve

20
serve/flash.sh Normal file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
SSH_OPTS="-o StrictHostKeychecking=no"
ssh $SSH_OPTS root@192.168.42.6 "cli request system zeroize"
echo "sleeping for 10"
sleep 10
./serve.sh &
while true;
do
if ping -w 1 -c 1 192.168.42.6 > /dev/null then
break
fi
done
echo "finished"

1
serve/serve.sh Executable file
View file

@ -0,0 +1 @@
python -m http.server 8080 -d ./serve