From 9015ff46c94e00367beaaef8cb11b59738dd015e Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Thu, 16 Apr 2026 09:23:36 -0700 Subject: [PATCH] fix root check to use if block instead of fragile && chain --- hub/onboard-spoke.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hub/onboard-spoke.sh b/hub/onboard-spoke.sh index 03d48e5..2085639 100644 --- a/hub/onboard-spoke.sh +++ b/hub/onboard-spoke.sh @@ -4,7 +4,10 @@ set -euo pipefail RCLONE_CONF="${HOME}/.config/rclone/rclone.conf" SSH_DIR="${HOME}/.ssh" -[ "$(id -u)" -eq 0 ] && echo -e "\033[0;31m[WARNING]\033[0m Running as root — keys will be written to /root/.ssh. Run as armbian instead." && exit 1 || true +if [ "$(id -u)" -eq 0 ]; then + echo -e "\033[0;31m[WARNING]\033[0m Running as root — keys will be written to /root/.ssh. Run as armbian instead." + exit 1 +fi mkdir -p "$SSH_DIR" touch "$SSH_DIR/known_hosts" chmod 700 "$SSH_DIR"