Invert group modification, redirect getent query to /dev/null
This commit is contained in:
@@ -36,11 +36,11 @@ if [ "$UID" != "1000" ]; then
|
|||||||
fi
|
fi
|
||||||
# Change the group, if the $GID changed.
|
# Change the group, if the $GID changed.
|
||||||
if [ "$GID" != "1000" ]; then
|
if [ "$GID" != "1000" ]; then
|
||||||
getent group | grep ":$GID:"
|
getent group | grep ":$GID:" &>/dev/null
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
groupmod -g $GID $UNAME
|
usermod -g $GID -G 1000 $UNAME
|
||||||
else
|
else
|
||||||
usermod -g $UID -G $GID $UNAME
|
groupmod -g $GID $UNAME
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user