If i have two users, say, 'bob' and 'bobby', and configure:
UID_bob: 1005
...
UID_bobby: 1006
...
Then the UID for 'bob' will fail to be applied.
This line:
ACCOUNT_UID=$(env | grep '^UID_'"$ACCOUNT_NAME" | sed 's/^[^=]*=//g')
will end up grep'ing for '^UID_bob', which will match BOTH users. It should instead be:
ACCOUNT_UID=$(env | grep '^UID_'"$ACCOUNT_NAME"'=' | sed 's/^[^=]*=//g')
So it will also ensure there is an '=' at the end of the user name.