From 1d4b941873b670525fd159dcb9c01bb2570b0565 Mon Sep 17 00:00:00 2001 From: David Coppit Date: Sun, 21 Jan 2018 11:26:54 -0500 Subject: [PATCH] Fix hard-coded user and group IDs Thanks to dth202 for the fix here: https://github.com/coppit/docker-filebot/issues/17 --- runas.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runas.sh b/runas.sh index 39bcb55..ecf3e0f 100755 --- a/runas.sh +++ b/runas.sh @@ -42,9 +42,9 @@ function create_user { USER="user_${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 - USER=$(grep '^[^:]*:[^:]*:99:100:' /etc/passwd | sed 's/:.*//') + USER=$(grep "^[^:]*:[^:]*:$USER_ID:$GROUP_ID:" /etc/passwd | sed 's/:.*//') if [[ $USER == *$'\n'* ]] then @@ -56,9 +56,9 @@ function create_user { return fi - if grep -q '^[^:]*:[^:]*:99:' /etc/passwd >/dev/null 2>&1 + if grep -q "^[^:]*:[^:]*:$USER_ID:" /etc/passwd >/dev/null 2>&1 then - USER=$(grep '^[^:]*:[^:]*:99:100:' /etc/passwd | sed 's/:.*//') + USER=$(grep "^[^:]*:[^:]*:$USER_ID:" /etc/passwd | sed 's/:.*//') if [[ $USER == *$'\n'* ]] then