aboutsummaryrefslogblamecommitdiff
path: root/bin/sta.sh
blob: a32e87f6c46a23ff5b6c8db617284fce838ba57c (plain) (tree)
1
2
3
4
5
6
7
                                                                             
                                                                              
                                 
                               


                                                      
# Print list of sls(1df) hostnames that exit 0 when a connection is attempted
# and the optional given command is run.  Discard stdout, but preserve stderr.
sls | while read -r hostname ; do
    # shellcheck disable=SC2029
    ssh -nq -- "$hostname" "$@" >/dev/null || continue
    printf '%s\n' "$hostname"
done