Update utils scripts
This commit is contained in:
parent
cad06cae96
commit
3549901946
2 changed files with 14 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
export LEGO_WORKING_PATH="/opt/lego/"
|
||||
LEGO_WORKING_PATH="/opt/services/.lego/"
|
||||
|
||||
set -e
|
||||
|
||||
|
@ -27,6 +27,15 @@ lego -a --email "tobias@msrg.cc" \
|
|||
|
||||
# Copy registry.serguzim.me files to harbor data directory
|
||||
if [ "$domain" = "registry.serguzim.me" ]; then
|
||||
echo "Deploying certificates for registry.serguzim.me"
|
||||
sudo cp "$LEGO_WORKING_PATH/certificates/registry.serguzim.me.crt" /opt/services/harbor/data/secret/cert/server.crt
|
||||
sudo cp "$LEGO_WORKING_PATH/certificates/registry.serguzim.me.key" /opt/services/harbor/data/secret/cert/server.key
|
||||
fi
|
||||
|
||||
# Copy db.serguzim.me files to postgresql data directory
|
||||
if [ "$domain" = "db.serguzim.me" ]; then
|
||||
echo "Deploying certificates for db.serguzim.me"
|
||||
sudo cp "$LEGO_WORKING_PATH/certificates/db.serguzim.me.crt" /var/lib/postgres/data/server.crt
|
||||
sudo cp "$LEGO_WORKING_PATH/certificates/db.serguzim.me.key" /var/lib/postgres/data/server.key
|
||||
sudo -u postgres pg_ctl -D /var/lib/postgres/data/ reload
|
||||
fi
|
||||
|
|
|
@ -26,6 +26,10 @@ pg_path="/opt/pgsql-$pg_version/bin"
|
|||
[ -d "$pg_path" ] || exit
|
||||
sudo -u postgres pg_upgrade -b "$pg_path" -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data
|
||||
|
||||
printf "\nStep 5.1: Copy config files - continue? "; read
|
||||
sudo -u postgres cp /var/lib/postgres/olddata/pg_hba.conf /var/lib/postgres/data/
|
||||
sudo -u postgres cp /var/lib/postgres/olddata/postgresql.conf /var/lib/postgres/data/
|
||||
|
||||
|
||||
printf "\nStep 6: Restart database - continue? "; read
|
||||
systemctl start postgresql.service
|
||||
|
|
Reference in a new issue