powercuts and reboots
This commit is contained in:
parent
9271aeb39a
commit
0351216f34
2 changed files with 52 additions and 0 deletions
24
powercut.sh
Executable file
24
powercut.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/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"
|
||||
28
reboot.sh
Executable file
28
reboot.sh
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SSH_OPTS="-o StrictHostKeyChecking=no"
|
||||
|
||||
ssh $SSH_OPTS root@192.168.42.6 "reboot"
|
||||
|
||||
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")-reboot"
|
||||
|
||||
mkdir -p "$dir"
|
||||
|
||||
touch "$dir/reboot"
|
||||
|
||||
cp ./reboot.sh "$dir"
|
||||
|
||||
echo "finished"
|
||||
Loading…
Add table
Add a link
Reference in a new issue