diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2020-09-13 16:40:54 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2020-09-13 16:40:54 -0400 |
| commit | 5debb8c4b7afeb531b1584595343390e4f07b113 (patch) | |
| tree | 962a4046ad9436c0c5aa838ba075ea472fb1090e /entrypoint.sh | |
| parent | 578b04e3f380cfd674cd545f6a4d673b4e046bf5 (diff) | |
| download | alpine-cgit-5debb8c4b7afeb531b1584595343390e4f07b113.tar.gz alpine-cgit-5debb8c4b7afeb531b1584595343390e4f07b113.tar.xz | |
Do not run setup multiple times in a container's life. Also update scripts
Diffstat (limited to 'entrypoint.sh')
| -rwxr-xr-x | entrypoint.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/entrypoint.sh b/entrypoint.sh index 11c2a7e..1072ba6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,12 +23,14 @@ NGINX_WORKER_CONNECTIONS="${NGINX_WORKER_CONNECTIONS:-1024}" printf "\033[0m" setup() { +if [ -e /setup ] ; then return ; fi if [ "$(find /var/git -type f | wc -l)" -eq 0 ] ; then cp -r /var/default/git/* /var/git/ fi -addgroup -g "${CGIT_GID}" git +addgroup -g "${CGIT_GID}" git adduser -h /var/git --gecos "$FULL_NAME" -D -s "${CGIT_SHELL}" -u "${CGIT_UID}" -G git git + chown -R git:git /var/git passwd -u git @@ -38,6 +40,8 @@ if [ -n "$AUTHORIZED_KEYS" ] ; then mkdir -p /etc/ssh/keys echo "$AUTHORIZED_KEYS" | tee /etc/ssh/keys/git fi + +touch /setup } # exec runsvdir /var/service @@ -165,7 +169,6 @@ run_nginx run_cgit run_sshd - set +x # Bail out if a service stops, poll it every 30 seconds watchServices 30 |
