graphene-os-server-infrastr.../reboot

28 lines
351 B
Plaintext
Raw Normal View History

2024-11-29 15:24:26 -05:00
#!/bin/bash
set -o errexit -o nounset -o pipefail
[[ $# -eq 2 ]] || exit 1
input=
read -p "Reboot $1 servers with $2 second delay? " input
2024-11-29 15:24:26 -05:00
if [[ $input != yes ]]; then
exit 1
fi
echo
user=root
. hosts.sh
declare -n hosts=hosts_$1
for host in ${hosts[@]}; do
echo $host
echo
systemctl -H $host reboot
sleep $2
echo
done