1
0
Fork 0
junos-testing-framework/flash.sh
2026-01-24 13:12:03 +01:00

34 lines
562 B
Bash
Executable file

#!/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 "collecting logs"
dir="./logs/$(date +"%Y%m%d_%H%M%S")-zeroize"
mkdir -p "$dir"
touch "$dir/zeroize"
cp "./serve/config.txt" "$dir/"
cp ./flash.sh "$dir"
echo "finished"