From 80c32de8b4de0b632fe5718bb44cc57b33c3c7cc Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Wed, 21 Feb 2024 04:40:45 +0100 Subject: [PATCH 1/7] add ardware watchdog device presence check --- scripts/install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/install b/scripts/install index 2ea9cb1..e8afb1a 100644 --- a/scripts/install +++ b/scripts/install @@ -8,6 +8,16 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# WATCHDOG DEVICE CHECK +#================================================= + +ynh_script_progression --message="Checking the hardware watchdog device presence..." + +if [ ! -f /dev/watchdog ]; then + ynh_die --message="Your server doesn't seem to have a '/dev/watchdog' device, this certainly means that it has no hardware watchdog device. However, this package is only relevant if such a device exists, we're sorry." +fi + #================================================= # INSTALL DEPENDENCIES #================================================= From 38fe6ee3135d48099706edd29e7f0ccd19a509ec Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Wed, 21 Feb 2024 04:40:50 +0100 Subject: [PATCH 2/7] update docs --- doc/DESCRIPTION.md | 4 ++-- doc/DESCRIPTION_fr.md | 4 ++-- doc/POST_INSTALL.md | 2 +- doc/POST_INSTALL_fr.md | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 doc/POST_INSTALL_fr.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 2210e8d..834fce2 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,5 +1,5 @@ -A watchdog service makes sure your server is still running and reboots it if necessary. -It better (only?) works if your server has a hardware watchdog device. +A watchdog service makes sure your server is still running and reboots it if necessary. +It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer). The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 709eb5b..6fa02b1 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,5 +1,5 @@ -Un service de surveillance *watchdog* s'assure que votre serveur tourne toujours, et le redémarre si nécessaire. -Il tournera préférentiellement (uniquement?) si votre serveur est équipé d'un *watchdog* matériel. +Un service de surveillance *watchdog* s'assure que votre serveur tourne toujours, et le redémarre si nécessaire. +Il tournera préférentiellement (uniquement?) si votre serveur est équipé d'un [*watchdog*](https://fr.wikipedia.org/wiki/Chien_de_garde_(informatique)) matériel. Le service inclut ira régulièrement écrire dans `/dev/watchdog`. S'il s'arrête, le plantage est alors détecté et résolu par un redémarrage du système. diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 81db4b1..8af9f20 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,3 +1,3 @@ Your device boot configuration has been updated to enable the hardware watchdog. -Please reboot it. +Please reboot your server. diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md new file mode 100644 index 0000000..26bc230 --- /dev/null +++ b/doc/POST_INSTALL_fr.md @@ -0,0 +1,3 @@ +La configuration de démarrage de votre appareil a été mise à jour pour activer le chien de garde matériel. + +Veuillez redémarrer votre server. From 3641379572f65316bff8dd82cbdd9369682680b0 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 21 Feb 2024 03:40:54 +0000 Subject: [PATCH 3/7] Auto-update README --- README.md | 8 ++++---- README_fr.md | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8976b82..d0f8b80 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -16,8 +16,8 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -A watchdog service makes sure your server is still running and reboots it if necessary. -It better (only?) works if your server has a hardware watchdog device. +A watchdog service makes sure your server is still running and reboots it if necessary. +It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer). The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. @@ -43,4 +43,4 @@ or sudo yunohost app upgrade watchdog -u https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug ``` -**More info regarding app packaging:** +**More info regarding app packaging:** \ No newline at end of file diff --git a/README_fr.md b/README_fr.md index 0c117fd..ead8446 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,5 +1,5 @@ @@ -16,8 +16,8 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Un service de surveillance *watchdog* s'assure que votre serveur tourne toujours, et le redémarre si nécessaire. -Il tournera préférentiellement (uniquement?) si votre serveur est équipé d'un *watchdog* matériel. +Un service de surveillance *watchdog* s'assure que votre serveur tourne toujours, et le redémarre si nécessaire. +Il tournera préférentiellement (uniquement?) si votre serveur est équipé d'un [*watchdog*](https://fr.wikipedia.org/wiki/Chien_de_garde_(informatique)) matériel. Le service inclut ira régulièrement écrire dans `/dev/watchdog`. S'il s'arrête, le plantage est alors détecté et résolu par un redémarrage du système. From 09f37b6497e9d8221bc5bee5741b7798d3e90976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 28 May 2024 20:35:55 +0200 Subject: [PATCH 4/7] cleaning --- manifest.toml | 2 +- scripts/install | 5 ----- scripts/upgrade | 8 -------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/manifest.toml b/manifest.toml index f1b8122..096996b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -6,7 +6,7 @@ name = "Watchdog" description.en = "Automatically reboot your server in case of freeze" description.fr = "Redémarre automatiquement votre serveur en cas de plantage" -version = "5.16~ynh1" +version = "5.16~ynh2" maintainers = ["tituspijean"] diff --git a/scripts/install b/scripts/install index e8afb1a..1278645 100644 --- a/scripts/install +++ b/scripts/install @@ -11,17 +11,12 @@ source /usr/share/yunohost/helpers #================================================= # WATCHDOG DEVICE CHECK #================================================= - ynh_script_progression --message="Checking the hardware watchdog device presence..." if [ ! -f /dev/watchdog ]; then ynh_die --message="Your server doesn't seem to have a '/dev/watchdog' device, this certainly means that it has no hardware watchdog device. However, this package is only relevant if such a device exists, we're sorry." fi -#================================================= -# INSTALL DEPENDENCIES -#================================================= - #================================================= # SYSTEM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index cdf6ab8..00352c1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,14 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= - #================================================= # STOP SYSTEMD SERVICE #================================================= From e0a9acf4a41a7667b7ff879239959356b2273ab3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 28 May 2024 21:31:25 +0000 Subject: [PATCH 5/7] Auto-update READMEs --- ALL_README.md | 4 +++- README.md | 10 ++++++---- README_es.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ README_eu.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 6 +++--- README_gl.md | 6 +++--- README_zh_Hans.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 153 insertions(+), 11 deletions(-) create mode 100644 README_es.md create mode 100644 README_eu.md create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md index 3d6c579..152f2e7 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,8 @@ # All available README files by language - [Read the README in English](README.md) +- [Lea el README en español](README_es.md) +- [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) -- [Leggi il “README” in italiano](README_it.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index a744db6..f67cc16 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Watchdog for YunoHost @@ -7,7 +9,7 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app [![Install Watchdog with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog) -*[Read this README is other languages.](./ALL_README.md)* +*[Read this README in other languages.](./ALL_README.md)* > *This package allows you to install Watchdog quickly and simply on a YunoHost server.* > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* @@ -22,7 +24,7 @@ The included sercice will regularly write to `/dev/watchdog`. If it stops, then This app has only been tested on Raspberry Pi. -**Shipped version:** 5.16~ynh1 +**Shipped version:** 5.16~ynh2 ## Documentation and resources - Upstream app code repository: @@ -41,4 +43,4 @@ or sudo yunohost app upgrade watchdog -u https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug ``` -**More info regarding app packaging:** \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..c3e2096 --- /dev/null +++ b/README_es.md @@ -0,0 +1,46 @@ + + +# Watchdog para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/watchdog.svg)](https://dash.yunohost.org/appci/app/watchdog) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/watchdog.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/watchdog.maintain.svg) + +[![Instalar Watchdog con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarWatchdog rapidamente y simplement en un servidor YunoHost.* +> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* + +## Descripción general + +A watchdog service makes sure your server is still running and reboots it if necessary. +It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer). + +The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. + +This app has only been tested on Raspberry Pi. + + +**Versión actual:** 5.16~ynh2 +## Documentaciones y recursos + +- Repositorio del código fuente oficial de la aplicación : +- Catálogo YunoHost: +- Reportar un error: + +## Información para desarrolladores + +Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug +o +sudo yunohost app upgrade watchdog -u https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..7b99c30 --- /dev/null +++ b/README_eu.md @@ -0,0 +1,46 @@ + + +# Watchdog YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/watchdog.svg)](https://dash.yunohost.org/appci/app/watchdog) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/watchdog.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/watchdog.maintain.svg) + +[![Instalatu Watchdog YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Watchdog YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +A watchdog service makes sure your server is still running and reboots it if necessary. +It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer). + +The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. + +This app has only been tested on Raspberry Pi. + + +**Paketatutako bertsioa:** 5.16~ynh2 +## Dokumentazioa eta baliabideak + +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug +edo +sudo yunohost app upgrade watchdog -u https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 27cf0f8..d22fd54 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Watchdog pour YunoHost @@ -24,7 +24,7 @@ Le service inclut ira régulièrement écrire dans `/dev/watchdog`. S'il s'arrê Cette application n'a été testée que sur Raspberry Pi. -**Version incluse :** 5.16~ynh1 +**Version incluse :** 5.16~ynh2 ## Documentations et ressources - Dépôt de code officiel de l’app : diff --git a/README_gl.md b/README_gl.md index b4e0a71..1f6046f 100644 --- a/README_gl.md +++ b/README_gl.md @@ -16,15 +16,15 @@ NON debe editarse manualmente. ## Vista xeral -A watchdog service makes sure your server is still running and reboots it if necessary. -It better (only?) works if your server has a hardware watchdog device. +A watchdog service makes sure your server is still running and reboots it if necessary. +It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer). The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. This app has only been tested on Raspberry Pi. -**Versión proporcionada:** 5.16~ynh1 +**Versión proporcionada:** 5.16~ynh2 ## Documentación e recursos - Repositorio de orixe do código: diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..7c23e2b --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,46 @@ + + +# YunoHost 上的 Watchdog + +[![集成程度](https://dash.yunohost.org/integration/watchdog.svg)](https://dash.yunohost.org/appci/app/watchdog) ![工作状态](https://ci-apps.yunohost.org/ci/badges/watchdog.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/watchdog.maintain.svg) + +[![使用 YunoHost 安装 Watchdog](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=watchdog) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Watchdog。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +A watchdog service makes sure your server is still running and reboots it if necessary. +It better (only?) works if your server has a [hardware watchdog device](https://en.wikipedia.org/wiki/Watchdog_timer). + +The included sercice will regularly write to `/dev/watchdog`. If it stops, then the freeze is detected and server rebooted. + +This app has only been tested on Raspberry Pi. + + +**分发版本:** 5.16~ynh2 +## 文档与资源 + +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug +或 +sudo yunohost app upgrade watchdog -u https://github.com/YunoHost-Apps/watchdog_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From 8dfb567892a947f4da1cfb9ca5e8094b86b650b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 20 Jun 2024 23:35:04 +0200 Subject: [PATCH 6/7] Fix install in CI --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1278645..e3d9a9e 100644 --- a/scripts/install +++ b/scripts/install @@ -13,7 +13,8 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Checking the hardware watchdog device presence..." -if [ ! -f /dev/watchdog ]; then +# Don't issue this error in CI +if [ "${PACKAGE_CHECK_EXEC:-0}" -eq 0 ] && [ ! -f /dev/watchdog ]; then ynh_die --message="Your server doesn't seem to have a '/dev/watchdog' device, this certainly means that it has no hardware watchdog device. However, this package is only relevant if such a device exists, we're sorry." fi From 495932cd938eba1454742a4af9523f1484c1e5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 20 Jun 2024 23:46:10 +0200 Subject: [PATCH 7/7] Coding style, apply template --- manifest.toml | 6 ++++-- scripts/backup | 4 ++++ scripts/install | 19 ++++--------------- scripts/remove | 16 +++------------- scripts/restore | 9 +++------ scripts/upgrade | 19 +++++-------------- 6 files changed, 23 insertions(+), 50 deletions(-) diff --git a/manifest.toml b/manifest.toml index 096996b..6fd3b8c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + packaging_format = 2 id = "watchdog" @@ -16,7 +18,7 @@ license = "GPL-2.0-or-later" code = "https://sourceforge.net/projects/watchdog/" [integration] -yunohost = ">= 11.2" +yunohost = ">=11.2" architectures = "all" multi_instance = false ldap = "not_relevant" @@ -30,4 +32,4 @@ ram.runtime = "50M" [resources] [resources.apt] - packages = "watchdog" + packages = ["watchdog"] diff --git a/scripts/backup b/scripts/backup index a1475cf..e8a9540 100644 --- a/scripts/backup +++ b/scripts/backup @@ -18,6 +18,10 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="/etc/watchdog.conf" +# Remove other various files specific to the app... such as : + +ynh_backup --src_path="/var/log/$app" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index e3d9a9e..1727c9a 100644 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -28,28 +26,19 @@ if [[ $(grep -ic "Raspberry Pi" /proc/cpuinfo) -ge 1 && $(grep -ic "dtparam=watc echo "dtparam=watchdog=on" >> /boot/config.txt fi -yunohost service add $app - -#================================================= -# APP INITIAL CONFIGURATION -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding app's configuration file..." - ynh_add_config --template="watchdog.conf" --destination="/etc/watchdog.conf" - chmod 400 "/etc/watchdog.conf" chown root: "/etc/watchdog.conf" +systemctl enable "$app.service" --quiet +yunohost service add "$app" + #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting app's systemd service..." -# Enable and start a systemd service -systemctl enable $app.service --quiet -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 97ae1b9..3c95663 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,37 +1,27 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source _common.sh source /usr/share/yunohost/helpers -#================================================= -# REMOVE SYSTEM CONFIGURATIONS #================================================= # REMOVE SYSTEMD SERVICE #================================================= ynh_script_progression --message="Removing system configurations related to $app..." # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." - yunohost service remove $app +if ynh_exec_warn_less yunohost service status $app >/dev/null; then + yunohost service remove "$app" fi ynh_remove_systemd_config ynh_remove_nginx_config -# Remove other various files specific to the app... such as : - -ynh_secure_remove --file="/var/log/$app" - #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last \ No newline at end of file +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 0cc8d0e..1e15539 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -17,12 +15,11 @@ ynh_script_progression --message="Restoring system configurations related to $ap ynh_restore_file --origin_path="/etc/watchdog.conf" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet +yunohost service add "$app" -yunohost service add $app +ynh_restore_file --origin_path="/var/log/$app" -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 00352c1..434b54a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -21,26 +19,19 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Upgrading system configurations related to $app..." -yunohost service add $app - -#================================================= -# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) -#================================================= -# UPDATE A CONFIG FILE -#================================================= -ynh_script_progression --message="Updating a configuration file..." - ynh_add_config --template="watchdog.conf" --destination="/etc/watchdog.conf" - chmod 400 "/etc/watchdog.conf" chown root: "/etc/watchdog.conf" +systemctl enable "$app.service" --quiet +yunohost service add "$app" + #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT