comparison host/update.sh @ 2116:059afc92310b ssltesting

split update.sh
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 05 Jan 2026 14:02:55 -0700
parents 3112b06ab447
children
comparison
equal deleted inserted replaced
2115:5b434c8a27bd 2116:059afc92310b
1 #!/bin/bash 1 #!/bin/bash
2
3 set -e 2 set -e
4 # prevents error if there is nothing in sites/
5 shopt -s nullglob
6
7 SCRIPT_DIR="$(cd -- "$(dirname -- "$0")" && pwd)"
8 cd $SCRIPT_DIR
9 3
10 ./stop.sh 4 ./stop.sh
11 5
12 echo Updating hg 6 echo Updating hg
13 hg pull -u 7 hg pull -u
14 8
15 ../scripts/build-luan.sh 9 ./update2.sh
16
17 mkdir -p local
18 mkdir -p logs
19 rm -f logs/*
20 hg identify >logs/changeset.txt
21
22 if [ ! -f local/tiny_account.key ]; then
23 echo "Register letsencrypt (tiny-acme)"
24 openssl genrsa 4096 >local/tiny_account.key
25 fi
26
27 cp startup/nginx/mime.types local/mime.types
28 # id -gn gets the name of the primary group of the current user (staff)
29 luan startup/nginx/nginx.conf.luan $(pwd) $(whoami) $(id -gn) >local/nginx.conf
30 luan startup/nginx/nginx.default.conf.luan $(pwd) >local/nginx.default.conf
31
32 # this is done because the nginx conf uses absolute paths
33 # and this breaks sites when the luan/host directory is moved
34 luan classpath:luan/host/update.luan
35
36 echo Starting...
37 ./start.sh