1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00

Update restore

This commit is contained in:
ericgaspar 2021-01-10 23:08:03 +01:00
parent df550e3de4
commit 479b700916
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -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