diff options
| author | yalh76 <yalh@yahoo.com> | 2019-03-21 02:07:49 +0100 |
|---|---|---|
| committer | yalh76 <yalh@yahoo.com> | 2019-03-21 02:07:49 +0100 |
| commit | 1d2c258abe21e48a32da63c8a90573c95a6bd773 (patch) | |
| tree | 277e66a86df804ba6f4e0d78d6bcb7f06f4096f8 /scripts/restore | |
| parent | f8096d8c256c021d290701b41767b77fdecef1c1 (diff) | |
| download | mastodon_ynh-1d2c258abe21e48a32da63c8a90573c95a6bd773.tar.gz mastodon_ynh-1d2c258abe21e48a32da63c8a90573c95a6bd773.tar.bz2 mastodon_ynh-1d2c258abe21e48a32da63c8a90573c95a6bd773.zip | |
Apply example_ynh
Diffstat (limited to 'scripts/restore')
| -rw-r--r-- | scripts/restore | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/restore b/scripts/restore index 969f3ca..398648f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,8 +26,8 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path) -is_public=$(ynh_app_setting_get $app is_public) -final_path=$(ynh_app_setting_get "$app" final_path) +final_path=$(ynh_app_setting_get $app final_path) +db_name=$(ynh_app_setting_get $app db_name) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -59,7 +59,8 @@ ynh_restore_file "$final_path" #================================================= ynh_print_info "Recreating the dedicated system user..." -adduser $app --home $final_path --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password +# Create the dedicated user (if not existing) +ynh_system_user_create $app $final_path #================================================= # RESTORE USER RIGHTS @@ -103,7 +104,6 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_print_info "Restoring the PostgreSQL database..." -db_name=$(ynh_app_setting_get "$app" db_name) db_pwd=$(ynh_app_setting_get "$app" db_pwd) ynh_psql_test_if_first_run @@ -112,8 +112,6 @@ ynh_psql_execute_as_root \ "CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;" ynh_psql_execute_file_as_root ./db.sql "$db_name" - - #================================================= # RESTORE SYSTEMD #================================================= |
