From bd51519c58cbe8e8afa8d6a99a31d5e1531e0d04 Mon Sep 17 00:00:00 2001 From: Alex Meyer Date: Sat, 31 Jul 2021 23:12:21 -0400 Subject: [PATCH] Different way to search for existing PUID Just grepping for PUID in /etc/passwd can accidentally catch group IDs with that same number. The `id` command returns whether or not there's a user with that ID more reliably. --- qbittorrent/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qbittorrent/start.sh b/qbittorrent/start.sh index 02bfff4..7a5745a 100644 --- a/qbittorrent/start.sh +++ b/qbittorrent/start.sh @@ -77,7 +77,7 @@ else fi # Check if the PUID exists, if not create the user with the name 'qbittorrent', with the correct group -grep $"${PUID}:" /etc/passwd > /dev/null 2>&1 +id ${PUID} > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "[INFO] An user with PUID $PUID already exists in /etc/passwd, nothing to do." | ts '%Y-%m-%d %H:%M:%.S' else