forked from finn/tinyboard
fix usermod group assignment to use if blocks instead of && chain
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user