move cron to shell

This commit is contained in:
neil 2017-06-06 09:20:50 +08:00
parent 19cce31a09
commit f20864f42e
2 changed files with 11 additions and 3 deletions

View file

@ -1,4 +1,2 @@
dockergen: docker-gen -watch -notify "/app/updatessl.sh updatessl" /app/nginx.tmpl /etc/nginx/conf.d/default.conf
nginx: nginx
cron: cron && tail -f /dev/null
nginx: nginx

View file

@ -10,6 +10,15 @@ DEFAULT_CONF="/etc/nginx/conf.d/default.conf"
CERTS="/etc/nginx/certs"
startcron() {
if service cron status | grep "cron is running"; then
echo "cron is running, skip"
else
service cron start
fi
}
updatessl() {
if grep ACME_DOMAINS $DEFAULT_CONF ; then
@ -33,6 +42,7 @@ updatessl() {
}
startcron
"$@"