blob: 6c2819181b7ebcf169b66996f0ff2b0538ef12ca (
plain) (
tree)
|
|
#!/bin/sh
# Run ssh(1) with an optional command on every host in sls(1) output
# Use FD3 to keep a reference to the script's stdin for the ssh(1) calls
exec 3<&0
sls | while read -r hostname ; do
printf 'sra: %s\n' "$hostname"
ssh -qt -- "$hostname" "$@" <&3 # shellcheck disable=SC2029
done
|