From d79c4fcfe4a2c07681598c7eebb729fee059a2c8 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 12 Oct 2017 18:21:54 +0530 Subject: [PATCH] scripts: advertise service in admin panel --- scripts/install | 8 +++++++- scripts/remove | 8 ++++++++ scripts/restore | 6 ++++++ scripts/upgrade | 6 ++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1de367e..ac62069 100644 --- a/scripts/install +++ b/scripts/install @@ -152,12 +152,18 @@ sudo chown mattermost:adm "/var/log/mattermost.log" ynh_add_nginx_config #================================================= -# SETUP SYSTEMD +# SYSTEMD CONFIGURATION #================================================= # Create a dedicated systemd config ynh_add_systemd_config +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +sudo yunohost service add "$app" --log "/var/log/${app}.log" + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index fb23bcc..b481ff4 100755 --- a/scripts/remove +++ b/scripts/remove @@ -38,6 +38,14 @@ if [ -f "/etc/supervisor/conf.d/${app}.conf" ]; then sudo rm -f "/etc/supervisor/conf.d/${app}.conf" fi +#================================================= +# REMOVE SERVICE FROM ADMIN PANEL +#================================================= + +if sudo yunohost service status | grep -q "$app"; then + sudo yunohost service remove "$app" +fi + #================================================= # REMOVE THE MYSQL DATABASE #================================================= diff --git a/scripts/restore b/scripts/restore index 44f0694..2f95955 100644 --- a/scripts/restore +++ b/scripts/restore @@ -99,6 +99,12 @@ fi ynh_restore_file "/etc/systemd/system/$app.service" sudo systemctl enable "$app" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +sudo yunohost service add "$app" --log "/var/log/${app}.log" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 17a0bad..5f3cadb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,6 +109,12 @@ ynh_add_nginx_config ynh_add_systemd_config +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +sudo yunohost service add "$app" --log "/var/log/${app}.log" + #================================================= # SPECIFIC UPGRADE STEPS #=================================================