Fix hard-coded user and group IDs

Thanks to dth202 for the fix here: https://github.com/coppit/docker-filebot/issues/17
This commit is contained in:
David Coppit
2018-01-21 11:26:54 -05:00
parent c9e9c8b980
commit 1d4b941873

View File

@@ -42,9 +42,9 @@ function create_user {
USER="user_${USER_ID}_$GROUP_ID" USER="user_${USER_ID}_$GROUP_ID"
GROUP="group_${USER_ID}_$GROUP_ID" GROUP="group_${USER_ID}_$GROUP_ID"
if grep -q '^[^:]*:[^:]*:99:100:' /etc/passwd >/dev/null 2>&1 if grep -q "^[^:]*:[^:]*:$USER_ID:$GROUP_ID:" /etc/passwd >/dev/null 2>&1
then then
USER=$(grep '^[^:]*:[^:]*:99:100:' /etc/passwd | sed 's/:.*//') USER=$(grep "^[^:]*:[^:]*:$USER_ID:$GROUP_ID:" /etc/passwd | sed 's/:.*//')
if [[ $USER == *$'\n'* ]] if [[ $USER == *$'\n'* ]]
then then
@@ -56,9 +56,9 @@ function create_user {
return return
fi fi
if grep -q '^[^:]*:[^:]*:99:' /etc/passwd >/dev/null 2>&1 if grep -q "^[^:]*:[^:]*:$USER_ID:" /etc/passwd >/dev/null 2>&1
then then
USER=$(grep '^[^:]*:[^:]*:99:100:' /etc/passwd | sed 's/:.*//') USER=$(grep "^[^:]*:[^:]*:$USER_ID:" /etc/passwd | sed 's/:.*//')
if [[ $USER == *$'\n'* ]] if [[ $USER == *$'\n'* ]]
then then