fix: handle missing docker group in debian postinstall script (#1012)

Check if docker group exists before attempting to add beszel user to it, preventing installation failure when Docker is not installed.
This commit is contained in:
henrygd
2025-07-30 19:09:10 -04:00
parent ce93d54aa7
commit 75f66b0246

View File

@@ -31,10 +31,12 @@ if ! getent passwd "$SERVICE_USER" >/dev/null; then
--gecos "System user for $SERVICE"
fi
# Enable docker
if ! getent group docker | grep -q "$SERVICE_USER"; then
# Enable docker (only if docker group exists)
if getent group docker >/dev/null 2>&1; then
if ! getent group docker | grep -q "$SERVICE_USER"; then
echo "Adding $SERVICE_USER to docker group"
usermod -aG docker "$SERVICE_USER"
fi
fi
# Create config file if it doesn't already exist