diff options
| author | anmol26s <5068843+anmol26s@users.noreply.github.com> | 2018-08-30 17:13:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-30 17:13:33 -0400 |
| commit | 4a18fd0b38865ac9044ab99e85c3385d9586cbeb (patch) | |
| tree | 1220fab5e1f8a0113a9d04cf0bf71f6a045fbd9a /scripts | |
| parent | 531aaa6a47c87e41f18eff02a4dd10d2481f9a08 (diff) | |
| parent | fc1dee56d6d0885aedf7525515a9eff7fcda895b (diff) | |
| download | mastodon_ynh-4a18fd0b38865ac9044ab99e85c3385d9586cbeb.tar.gz mastodon_ynh-4a18fd0b38865ac9044ab99e85c3385d9586cbeb.tar.bz2 mastodon_ynh-4a18fd0b38865ac9044ab99e85c3385d9586cbeb.zip | |
Merge pull request #1 from anmol26s/patch-1
Patch 1
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/upgrade | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/upgrade b/scripts/upgrade index 0f99bab..0429013 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 |
