annotate addHostSsl.sh @ 20:8b4481769cc6

fix move logs
author Vadim Filimonov <fffilimonov@yandex.ru>
date Mon, 05 Aug 2024 11:32:22 +0300
parents dfc36e7ed22c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
1 #!/bin/bash
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
2
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
3 set -e
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
4
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
5 if [ $# -ne 1 ]; then
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
6 echo "usage: $0 domain.name";
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
7 exit 1;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
8 fi;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
9
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
10 HOST="$1";
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
11 ROOTPWD=$(pwd);
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
12
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
13 mkdir -p "$ROOTPWD/local/ssl";
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
14
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
15 cd letsencrypt;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
16 ./acme.sh --issue -d "$HOST" --stateless --cert-home "$ROOTPWD/local/ssl" --config-home "$ROOTPWD"/letsencrypt/config;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
17 cd ../;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
18
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
19 ./luan.sh nginx.ssl.conf.luan $ROOTPWD "$HOST" > config/nginx.ssl."$HOST".conf;
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
20
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
21 sudo /usr/local/bin/nginx -s reload;