diff addHostSsl.sh @ 0:dfc36e7ed22c

init
author Vadim Filimonov <fffilimonov@yandex.ru>
date Thu, 12 May 2022 13:51:59 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/addHostSsl.sh	Thu May 12 13:51:59 2022 +0400
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+if [ $# -ne 1 ]; then
+	echo "usage: $0 domain.name";
+    exit 1;
+fi;
+
+HOST="$1";
+ROOTPWD=$(pwd);
+
+mkdir -p "$ROOTPWD/local/ssl";
+
+cd letsencrypt;
+./acme.sh --issue -d "$HOST" --stateless --cert-home "$ROOTPWD/local/ssl" --config-home "$ROOTPWD"/letsencrypt/config;
+cd ../;
+
+./luan.sh nginx.ssl.conf.luan $ROOTPWD "$HOST" > config/nginx.ssl."$HOST".conf;
+
+sudo /usr/local/bin/nginx -s reload;