Skip to content

Commit

Permalink
Fix init script.
Browse files Browse the repository at this point in the history
  • Loading branch information
kudato committed Oct 7, 2019
1 parent f48645e commit 9af2e6d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/nginx.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
source /usr/bin/lib.sh

NGINX_HEALTHCHECK=/healthcheck/nginx.sh
# -----------------------------------------------------------
NGINX_CONFIG=/etc/nginx/nginx.conf

for i in \
Expand Down Expand Up @@ -61,23 +61,23 @@ if ! [[ -d /conf.d ]]
then
mkdir /conf.d
fi

# -----------------------------------------------------------
if ! [[ -d /healthcheck ]]
then
mkdir /healthcheck
fi

cat <<EOF > ${NGINX_HEALTHCHECK}
defaultEnv NGINX_PIDFILE=/var/run/nginx.pid
cat <<EOF > /healthcheck/nginx.sh
#!/usr/bin/env bash
source /usr/bin/lib.sh
source /usr/bin/checks.sh
if ! checkPidfile ${NGINX_PIDFILE}
then
exit 1
fi
exit 0
EOF
chmod +x /healthcheck/nginx.sh

chmod +x "${NGINX_HEALTHCHECK}"
exit 0

0 comments on commit 9af2e6d

Please sign in to comment.