From 66ed466f7e414e725605edd5da4c970df28c2e7e Mon Sep 17 00:00:00 2001 From: Karli Date: Sun, 1 May 2022 20:50:31 +0300 Subject: [PATCH] commands --- add-cron-for-certs.sh | 3 +++ create-certs.sh | 10 ++++++++++ cron-certs.sh | 4 ++++ start.sh | 3 +++ 4 files changed, 20 insertions(+) create mode 100644 add-cron-for-certs.sh create mode 100644 create-certs.sh create mode 100644 cron-certs.sh create mode 100644 start.sh diff --git a/add-cron-for-certs.sh b/add-cron-for-certs.sh new file mode 100644 index 0000000..383caa9 --- /dev/null +++ b/add-cron-for-certs.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +crontab -l | { cat; echo "0 0 * * 0 expr `date +\%W` \% 2 > /dev/null || /nordcod-nginx/cron-certs.sh"; } | crontab - diff --git a/create-certs.sh b/create-certs.sh new file mode 100644 index 0000000..2557943 --- /dev/null +++ b/create-certs.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +mv config/nginx.conf config/nginx.conf.bk +mv config/nginx.conf.initial config/nginx.conf +docker-compose up --build nginx -d # start nginx for acme challenge +docker-compose -f docker-compose-le.yaml up --build # create certs + +docker stop nordcod-nginx # now use nginx with full config +mv config/nginx.conf config/nginx.conf.initial +mv config/nginx.conf.bk config/nginx.conf diff --git a/cron-certs.sh b/cron-certs.sh new file mode 100644 index 0000000..a609cb3 --- /dev/null +++ b/cron-certs.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker-compose -f /nordcod-nginx/docker-compose-le.yaml up +docker exec -it nordcod-nginx nginx -s reload diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..df05471 --- /dev/null +++ b/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker-compose up --build nginx