mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
committed by
GitHub
parent
ca7642cc91
commit
20b822d072
@@ -316,18 +316,27 @@ fi
|
|||||||
# Create a dedicated user for the service if it doesn't exist
|
# Create a dedicated user for the service if it doesn't exist
|
||||||
if is_alpine; then
|
if is_alpine; then
|
||||||
if ! id -u beszel >/dev/null 2>&1; then
|
if ! id -u beszel >/dev/null 2>&1; then
|
||||||
|
echo "Creating a dedicated group for the Beszel Agent service..."
|
||||||
|
addgroup beszel
|
||||||
echo "Creating a dedicated user for the Beszel Agent service..."
|
echo "Creating a dedicated user for the Beszel Agent service..."
|
||||||
adduser -S -D -H -s /sbin/nologin beszel
|
adduser -S -D -H -s /sbin/nologin -G beszel beszel
|
||||||
fi
|
fi
|
||||||
# Add the user to the docker group to allow access to the Docker socket
|
# Add the user to the docker group to allow access to the Docker socket if group docker exists
|
||||||
addgroup beszel docker
|
if getent group docker; then
|
||||||
|
echo "Adding besel to docker group"
|
||||||
|
usermod -aG docker beszel
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
if ! id -u beszel >/dev/null 2>&1; then
|
if ! id -u beszel >/dev/null 2>&1; then
|
||||||
echo "Creating a dedicated user for the Beszel Agent service..."
|
echo "Creating a dedicated user for the Beszel Agent service..."
|
||||||
useradd --system --home-dir /nonexistent --shell /bin/false beszel
|
useradd --system --home-dir /nonexistent --shell /bin/false beszel
|
||||||
fi
|
fi
|
||||||
# Add the user to the docker group to allow access to the Docker socket
|
# Add the user to the docker group to allow access to the Docker socket if group docker exists
|
||||||
usermod -aG docker beszel
|
if getent group docker; then
|
||||||
|
echo "Adding besel to docker group"
|
||||||
|
usermod -aG docker beszel
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the directory for the Beszel Agent
|
# Create the directory for the Beszel Agent
|
||||||
|
Reference in New Issue
Block a user