mirror of
https://github.com/LamGC/jenkins-agent-with-docker.git
synced 2025-04-29 22:27:31 +00:00
调整用户检测过程。
This commit is contained in:
parent
1a258ea6fd
commit
c6c2a09bc8
@ -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 $@"
|
||||
|
Loading…
Reference in New Issue
Block a user