27 lines
463 B
Bash
Executable file
27 lines
463 B
Bash
Executable file
#!/bin/bash
|
|
|
|
|
|
function rebootMachine() {
|
|
local machine=$1
|
|
if (( ${machine} < 10 )); then
|
|
machine="0${machine}"
|
|
fi
|
|
machine="chrome${machine}.duensing.digital"
|
|
echo "Attempting reboot of ${machne}..."
|
|
sshpass -p password ssh -o "StrictHostKeyChecking=no" user@${machine} "reboot"
|
|
}
|
|
|
|
|
|
which -s sshpass
|
|
if [[ $? -eq 1 ]]; then
|
|
sudo apt-get install -y sshpass
|
|
fi
|
|
|
|
|
|
if [[ -z $1 ]]; then
|
|
for i in {1..13}; do
|
|
rebootMachine $i
|
|
done
|
|
else
|
|
rebootMachine $1
|
|
fi
|