diff --git a/ssh_tools/multissh.sh b/ssh_tools/multissh.sh index 725026e..8ecc403 100755 --- a/ssh_tools/multissh.sh +++ b/ssh_tools/multissh.sh @@ -17,7 +17,6 @@ set -u # Exit codes readonly EXIT_SUCCESS=0 readonly EXIT_USAGE=127 -readonly EXIT_DEPENDENCY=4 readonly EXIT_HOSTS_LIST=6 print_usage() @@ -39,6 +38,23 @@ err() printf '%s\n' "$@" >&2 } +warn() +{ + printf 'Warning! ' >&2 + printf '%s\n' "$@" >&2 +} + +ssh_command() +{ + grep -v '^#' "$HOSTS" | while read -r host ; do + [ -z "$host" ] && continue + echo "Executing command on '$host'..." + # shellcheck disable=SC2086 + ssh ${LOGIN} "${host}" -- "$@"