1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/glitchsoc_ynh.git synced 2024-09-03 19:15:59 +02:00

Merge pull request #1 from anmol26s/patch-1

Patch 1
This commit is contained in:
anmol26s 2018-08-30 17:13:33 -04:00 committed by GitHub
commit 4a18fd0b38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,6 +50,14 @@ if [[ "$admin" = "" || "$language" = "" ]]; then
ynh_die
fi
# If db_pwd doesn't exist, create it, need for old install
if [[ -z "$db_pwd" ]]; then
db_pwd=$(ynh_string_random)
ynh_app_setting_set $app db_pwd $db_pwd
ynh_psql_test_if_first_run
sudo --login --user=postgres psql -c"ALTER user $app WITH PASSWORD '$db_pwd'" postgres
ynh_replace_string "DB_PASS=" "DB_PASS=${db_pwd}" "${final_path}/live/.env.production"
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP