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

24 lines
312 B
Bash
Executable file

#!/usr/bin/env bash
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")-powercut"
mkdir -p "$dir"
touch "$dir/powercut"
cp ./powercut.sh "$dir"
echo "finished"