owenrusk.dev

dotfiles

shell, editor, ssh.

git clone https://owenrusk.dev/dotfiles.git

dotfiles / bin/both -rwxr-xr-x · 269 bytes

 1 #!/bin/sh
 2 # the same command on both stillwater boxes
 3 [ $# -gt 0 ] || { echo "usage: both command..." >&2; exit 2; }
 4 
 5 status=0
 6 for host in sw1 sw2; do
 7     printf '== %s\n' "$host"
 8     ssh "$host" "$@" || { echo "== $host failed ($?)" >&2; status=1; }
 9 done
10 exit $status