调整用户检测过程。

This commit is contained in:
LamGC 2023-03-27 13:31:50 +08:00
parent 1a258ea6fd
commit c6c2a09bc8
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -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 $@"