From efd85e33a4832995eac42c6e5987a8799cbf58c3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 23 Jan 2020 18:50:04 +0300 Subject: [PATCH] only create app user if it doesn't exist --- app/startup.sh | 6 ++++-- app/updater.sh | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/startup.sh b/app/startup.sh index 95ff947..cd6a9a7 100755 --- a/app/startup.sh +++ b/app/startup.sh @@ -5,8 +5,10 @@ while ! pg_isready -h $DB_HOST -U $DB_USER; do sleep 3 done -addgroup -g $OWNER_GID app -adduser -D -h /var/www/html -G app -u $OWNER_UID app +if ! id app; then + addgroup -g $OWNER_GID app + adduser -D -h /var/www/html -G app -u $OWNER_UID app +fi DST_DIR=/var/www/html/tt-rss SRC_REPO=https://git.tt-rss.org/fox/tt-rss.git diff --git a/app/updater.sh b/app/updater.sh index f81d83e..480a5d1 100755 --- a/app/updater.sh +++ b/app/updater.sh @@ -3,8 +3,10 @@ # wait for the app container to delete .app_is_ready and perform rsync, etc. sleep 30 -addgroup -g $OWNER_GID app -adduser -D -h /var/www/html -G app -u $OWNER_UID app +if ! id app; then + addgroup -g $OWNER_GID app + adduser -D -h /var/www/html -G app -u $OWNER_UID app +fi while ! pg_isready -h $DB_HOST -U $DB_USER; do echo waiting until $DB_HOST is ready...