From 479b70091620f076d9e346096f62b6183c97b743 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 10 Jan 2021 23:08:03 +0100 Subject: [PATCH] Update restore --- scripts/restore | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/restore b/scripts/restore index 8704491..96216dd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,11 +27,9 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) -data_path="/home/yunohost.app/$app" -logs_path="/var/log/$app" db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$(ynh_app_setting_get --app=$app --key=db_user) -db_pw=$(ynh_app_setting_get --app=$app --key=db_pw) +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #================================================= @@ -71,7 +69,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies # RESTORE THE APP DATA #================================================= -ynh_restore_file --origin_path="$data_path" +ynh_restore_file --origin_path="/home/yunohost.app/$app" #================================================= # RESTORE THE MYSQL DATABASE @@ -97,9 +95,10 @@ ynh_system_user_create --username=$app # Restore permissions on app files chown -R $app: $final_path -mkdir -p $data_path +#mkdir -p $data_path chown -R $app: $data_path +logs_path="/var/log/$app" mkdir -p $logs_path chown -R $app: $logs_path @@ -110,7 +109,7 @@ chown -R $app: $logs_path #================================================= ynh_restore_file "/etc/systemd/system/$app.service" -systemctl enable "$app" --quiet +systemctl enable $app --quiet #================================================= # ADVERTISE SERVICE IN ADMIN PANEL @@ -124,7 +123,7 @@ yunohost service add $app --description="A short description of the app" --log=" ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started Mattermost" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started Mattermost" #================================================= # GENERIC FINALIZATION