From 35676b48913c4c2612e28dc25f7c6645bf077c94 Mon Sep 17 00:00:00 2001 From: Raine Date: Mon, 30 Oct 2023 01:03:25 +0100 Subject: [PATCH] fix: sometimes we need path --- tools/server-setup.d/20-automation-user.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/server-setup.d/20-automation-user.sh b/tools/server-setup.d/20-automation-user.sh index 565c9dd..d103be9 100755 --- a/tools/server-setup.d/20-automation-user.sh +++ b/tools/server-setup.d/20-automation-user.sh @@ -1,6 +1,11 @@ #!/bin/bash -if ! cat -q "automation" /etc/passwd; then +if ! cat "$PATH" | grep -q "sbin"; then + # sudo is quirky + PATH="$PATH:/sbin" +fi + +if ! grep -q "automation" /etc/passwd; then echo "setting up automation user..." useradd -m automation