diff --git a/scripts/restore b/scripts/restore index 1291891..ec77dd9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -49,15 +49,25 @@ chown $app:$app "$install_dir/config.yaml" #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= - ynh_script_progression --message="Restoring system configurations related to $app..." --weight=3 + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -yunohost service add $app --description="Matrix Discord pupetting bridge for YunoHost" --log="/var/log/$app/$app.log" +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 ynh_restore_file --origin_path="/etc/logrotate.d/$app" +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + +yunohost service add $app --description="Matrix Discord pupetting bridge for YunoHost" --log="/var/log/$app/$app.log" + #================================================= # GENERIC FINALIZATION #================================================= @@ -65,15 +75,12 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Reloading $app's service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -# Wait until the synapse user is created -sleep 30 # (Note that, by default, non-admins might not have your homeserver's permission to create communities.) if [ "$bot_synapse_adm" = true ] then ynh_psql_execute_as_root --database=$synapse_db_name --sql="UPDATE users SET admin = 1 WHERE name = ""$botname"";" fi -ynh_systemd_action --service_name=$app --action="restart" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT