From 259143b87ea40170e8e81b0557c66be416b7333f Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 17 Jun 2024 23:24:34 +0000 Subject: [PATCH] scripts/check-uninsane: fix so `ssh servo systemctl --failed` actually works on servo, even when ssh key is locked --- scripts/check-uninsane | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/check-uninsane b/scripts/check-uninsane index d16e2e6e..214da187 100755 --- a/scripts/check-uninsane +++ b/scripts/check-uninsane @@ -23,6 +23,16 @@ check() { return $rc } +runOnHost() { + local host="$1" + shift + if [ "$host" = "$(hostname)" ]; then + "$@" + else + ssh "$host-hn" "$@" + fi +} + check "self-test" false 2> /dev/null if [ $last_error -eq 0 ]; then echo "SELF-TEST FAILED" >&2 @@ -70,7 +80,7 @@ check "ftp://uninsane.org" lftpgetIntoTmp ftp://uninsane.org/README.md README.md echo "" echo "systemctl --failed:" -ssh uninsane.org systemctl -q --failed +runOnHost servo systemctl -q --failed echo "" if [ $last_error -eq 0 ]; then