1
0
forked from finn/tinyboard

fix usermod group assignment to use if blocks instead of && chain

This commit is contained in:
Justin Oros
2026-04-16 10:26:28 -07:00
parent b706dd211d
commit 95a56ef4f0

View File

@@ -78,10 +78,14 @@ else
ADDED_TO_GROUP=false
if getent group sudo >/dev/null 2>&1; then
usermod -aG sudo armbian && ADDED_TO_GROUP=true
if usermod -aG sudo armbian 2>/dev/null; then
ADDED_TO_GROUP=true
fi
fi
if [ "$ADDED_TO_GROUP" = false ] && getent group wheel >/dev/null 2>&1; then
usermod -aG wheel armbian && ADDED_TO_GROUP=true
if usermod -aG wheel armbian 2>/dev/null; then
ADDED_TO_GROUP=true
fi
fi
if [ "$ADDED_TO_GROUP" = false ]; then
warn "Neither sudo nor wheel group found — armbian user has no sudo access."