annotate host/update.sh @ 1698:2dbcc8360a3e

backup security
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 27 Jun 2022 20:51:49 -0600
parents 0344a535b1db
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1628
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 #!/bin/bash
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 set -e
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 ./stop.sh
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 echo Updating hg
1629
Franklin Schmidt <fschmidt@gmail.com>
parents: 1628
diff changeset
8 hg pull -u
1628
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 ../scripts/build-luan.sh
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 mkdir -p local
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 mkdir -p logs
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 rm -f logs/*
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 hg identify >logs/changeset.txt
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16
1630
b735ed134662 add nginx and ssl for host
fffilimonov
parents: 1629
diff changeset
17 if [ ! -f local/leKey.txt ]; then
b735ed134662 add nginx and ssl for host
fffilimonov
parents: 1629
diff changeset
18 echo Register letsencrypt
1631
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents: 1630
diff changeset
19 ./acme.sh --register-account --cert-home ./sites --config-home local/letsencrypt/config 2>&1 | grep 'ACCOUNT_THUMBPRINT' | awk -F "'" '{print $2}' > local/leKey.txt;
1630
b735ed134662 add nginx and ssl for host
fffilimonov
parents: 1629
diff changeset
20 fi;
b735ed134662 add nginx and ssl for host
fffilimonov
parents: 1629
diff changeset
21
1632
0344a535b1db add doc
fffilimonov
parents: 1631
diff changeset
22 cp startup/nginx/mime.types local/mime.types;
0344a535b1db add doc
fffilimonov
parents: 1631
diff changeset
23 luan startup/nginx/nginx.conf.luan $(pwd) $(whoami) $(id -gn) > local/nginx.conf
0344a535b1db add doc
fffilimonov
parents: 1631
diff changeset
24 luan startup/nginx/nginx.default.conf.luan $(pwd) $(cat local/leKey.txt) > local/nginx.default.conf
1628
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 echo Starting...
520707a70379 add host
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 ./start.sh