mirror of
https://github.com/GrapheneOS/infrastructure.git
synced 2024-12-22 05:35:00 -05:00
add reboot script
This commit is contained in:
parent
3cdd4914d3
commit
7204b8d66e
27
reboot
Executable file
27
reboot
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit -o nounset -o pipefail
|
||||
|
||||
[[ $# -eq 2 ]] || exit 1
|
||||
|
||||
input=
|
||||
read -p "Reboot $1 servers? " input
|
||||
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
|
Loading…
Reference in New Issue
Block a user