diff --git a/scripts/install b/scripts/install index fca5967..9068b61 100644 --- a/scripts/install +++ b/scripts/install @@ -50,6 +50,22 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R ds:ds "$install_dir" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + yunohost service add "$service" +done + +#================================================= +# START SERVICES +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + ynh_systemd_action --action=restart --service_name="$service" +done + #================================================= # NGINX CONFIGURATION #================================================= diff --git a/scripts/remove b/scripts/remove index 93de249..287c8f1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -7,6 +7,17 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# REMOVE SERVICE FROM ADMIN PANEL +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + if yunohost service status "$service" >/dev/null 2>&1 + then + yunohost service remove "$service" + fi +done + #================================================= # REMOVE ONLYOFFICE #================================================= @@ -25,8 +36,6 @@ ynh_package_autopurge onlyoffice-documentserver dpkg --configure -a -apt-key del "E09C A29F 6E17 8040 EF22 B409 8320 CA65 CB2D E8E5" 2>/dev/null - #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= diff --git a/scripts/restore b/scripts/restore index 89df2da..a379264 100644 --- a/scripts/restore +++ b/scripts/restore @@ -59,6 +59,22 @@ ynh_script_progression --message="Restoring system configurations related to $ap ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + yunohost service add "$service" +done + +#================================================= +# START SERVICES +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + ynh_systemd_action --action=restart --service_name="$service" +done + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f8cd7d5..e2e760c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,6 +55,22 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R ds:ds "$install_dir" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + yunohost service add "$service" +done + +#================================================= +# START SERVICES +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + ynh_systemd_action --action=restart --service_name="$service" +done + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #=================================================