|
@@ -1,11 +1,25 @@
|
1
|
1
|
#! /usr/bin/env sh
|
2
|
2
|
|
3
|
|
-mkdir -p /etc/sitegen
|
4
|
|
-mkdir -p ~/.sitegen/hooks.d
|
5
|
|
-cp -r sitegen /etc/
|
6
|
|
-cp sitegen.sh /usr/local/bin/sitegen
|
7
|
|
-cp sitegen.completion /etc/bash_completion.d/sitegen
|
8
|
|
-
|
9
|
|
-cp generate-ssl-cert.sh /usr/local/bin/generate-ssl-cert
|
10
|
|
-cp cert-check.sh /usr/local/bin/cert-check
|
11
|
|
-cp cert-renew-all.sh /usr/local/bin/cert-renew-all
|
|
3
|
+dir="$(dirname $(readlink -f "${0}"))"
|
|
4
|
+
|
|
5
|
+if [ ! -e /etc/sitegen ]
|
|
6
|
+then
|
|
7
|
+ cp -r "${dir}/sitegen" /etc/sitegen
|
|
8
|
+fi &&
|
|
9
|
+
|
|
10
|
+cp "${dir}/sitegen.sh" /usr/local/bin/sitegen &&
|
|
11
|
+cp "${dir}/sitegen.completion" /etc/bash_completion.d/sitegen &&
|
|
12
|
+
|
|
13
|
+cp "${dir}/generate-ssl-cert.sh" /usr/local/bin/generate-ssl-cert &&
|
|
14
|
+cp "${dir}/cert-check.sh" /usr/local/bin/cert-check &&
|
|
15
|
+cp "${dir}/cert-renew-all.sh" /usr/local/bin/cert-renew-all &&
|
|
16
|
+
|
|
17
|
+cp "${dir}/apache/letsencrypt.conf" /etc/apache/conf-available/letsencrypt.conf &&
|
|
18
|
+a2enmod letsencrypt &&
|
|
19
|
+service apache2 reload &&
|
|
20
|
+
|
|
21
|
+if [ ! -e /etc/cron.d/cert-renew ]
|
|
22
|
+then
|
|
23
|
+ echo '12 00 * * 1 root cert-renew-all /etc/ssl/private $((60 * 60 * 24 * 31))' > /etc/cron.d/cert-renew
|
|
24
|
+fi &&
|
|
25
|
+service cron reload
|