summaryrefslogtreecommitdiffstats
path: root/tozt/certbot/files/bootstrap-certbot
diff options
context:
space:
mode:
Diffstat (limited to 'tozt/certbot/files/bootstrap-certbot')
-rwxr-xr-xtozt/certbot/files/bootstrap-certbot76
1 files changed, 0 insertions, 76 deletions
diff --git a/tozt/certbot/files/bootstrap-certbot b/tozt/certbot/files/bootstrap-certbot
deleted file mode 100755
index 5a563b2..0000000
--- a/tozt/certbot/files/bootstrap-certbot
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/env bash
-set -eu
-set -o pipefail
-
-config_dir="$1"
-if systemctl is-active -q nginx; then
- is_running=1
-else
- is_running=
-fi
-
-cleanup() {
- if [ -z "$is_running" ]; then
- systemctl stop nginx
- fi
-
- if [ -e /etc/nginx/nginx.conf.backup ]; then
- mv /etc/nginx/nginx.conf.backup /etc/nginx.conf
- fi
-}
-trap cleanup EXIT
-
-mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup
-cat > /etc/nginx/nginx.conf <<EOF
-worker_processes 1;
-events {
- worker_connections 1024;
-}
-http {
- server {
- listen 80 default;
- server_name tozt.net;
- location / {
- root /tmp;
- }
- }
- server {
- listen 80;
- server_name blog.tozt.net;
- location / {
- root /tmp;
- }
- }
- server {
- listen 80;
- server_name paste.tozt.net;
- location / {
- root /tmp;
- }
- }
- server {
- listen 80;
- server_name git.tozt.net;
- location / {
- root /tmp;
- }
- }
- server {
- listen 80;
- server_name rss.tozt.net;
- location / {
- root /tmp;
- }
- }
-}
-EOF
-
-if [ -z "$is_running" ]; then
- systemctl start nginx
-fi
-
-if [ -z "$config_dir" ]; then
- /usr/bin/certbot -n --agree-tos -m doy@tozt.net --nginx -d tozt.net -d blog.tozt.net -d paste.tozt.net -d git.tozt.net -d rss.tozt.net
-else
- /usr/bin/certbot -n --agree-tos -m doy@tozt.net --nginx -d tozt.net -d blog.tozt.net -d paste.tozt.net -d git.tozt.net -d rss.tozt.net --config-dir "$config_dir"
-fi