mirror of
https://github.com/GrapheneOS/infrastructure.git
synced 2025-01-02 10:36:11 -05:00
add batch command script
This commit is contained in:
parent
9710fd01bf
commit
b215624ad2
26
for
Executable file
26
for
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit -o nounset -o pipefail
|
||||
|
||||
[[ $# -eq 2 ]] || exit 1
|
||||
|
||||
input=
|
||||
read -p "Run command '$2' across $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
|
||||
|
||||
ssh $user@$host "$2"
|
||||
|
||||
echo
|
||||
done
|
Loading…
Reference in New Issue
Block a user