owenrusk.dev

dotfiles

shell, editor, ssh.

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

commit 6bfa9e7ce7156a408892e2ddfabb80a64d98a61d
parent cd5e41f9d0160055868826ba62f5c402d701751f
author Owen Rusk <owen@papermothgames.com>
date   2024-10-03 15:00:27 -0500
bin: both, run a command on sw1 and sw2
bin/both+8-0
diff --git a/bin/both b/bin/both
new file mode 100755
index 0000000..bdc62bb
--- /dev/null
+++ b/bin/both
@@ -0,0 +1,8 @@
+#!/bin/sh
+# the same command on both stillwater boxes
+[ $# -gt 0 ] || { echo "usage: both command..." >&2; exit 2; }
+
+for host in sw1 sw2; do
+    printf '== %s\n' "$host"
+    ssh "$host" "$@"
+done