From c6c2a09bc8e0660c01f2abccc91bfed3cd0be76e Mon Sep 17 00:00:00 2001 From: LamGC Date: Mon, 27 Mar 2023 13:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=A8=E6=88=B7=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E8=BF=87=E7=A8=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start-agent.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/start-agent.sh b/start-agent.sh index f0a7870..3cfa631 100644 --- a/start-agent.sh +++ b/start-agent.sh @@ -1,7 +1,7 @@ #!/bin/bash -if [ $(whoami) != "jenkins" ] || [ $(id -u) == "0" ]; then - echo "This script must be run as jenkins" +if [ $(id -u) != "0" ]; then + echo "This script must be run as root" exit 1 fi @@ -22,4 +22,5 @@ if [ $(id -u jenkins) -ne $UID ]; then echo "Changed jenkins UID" fi +echo "Starting agent..." su - jenkins -c "/usr/local/bin/jenkins-agent $@"