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 fca72a0..f67cc16 100644
--- a/README.md
+++ b/README.md
@@ -9,22 +9,22 @@ It shall NOT be edited by hand.
[](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.*
## 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.
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:
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
+
+[](https://dash.yunohost.org/appci/app/watchdog)  
+
+[](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
+
+[](https://dash.yunohost.org/appci/app/watchdog)  
+
+[](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 b61313e..d22fd54 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -16,15 +16,15 @@ Il NE doit PAS être modifié à la main.
## 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.
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/appci/app/watchdog)  
+
+[](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
+```
+
+**有关应用打包的更多信息:**
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.
diff --git a/manifest.toml b/manifest.toml
index f1b8122..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"
@@ -6,7 +8,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"]
@@ -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 2ea9cb1..1727c9a 100644
--- a/scripts/install
+++ b/scripts/install
@@ -1,7 +1,5 @@
#!/bin/bash
-#=================================================
-# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@@ -9,8 +7,14 @@ source _common.sh
source /usr/share/yunohost/helpers
#=================================================
-# INSTALL DEPENDENCIES
+# WATCHDOG DEVICE CHECK
#=================================================
+ynh_script_progression --message="Checking the hardware watchdog device presence..."
+
+# 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
#=================================================
# SYSTEM CONFIGURATION
@@ -22,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 cdf6ab8..434b54a 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -1,7 +1,5 @@
#!/bin/bash
-#=================================================
-# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@@ -9,14 +7,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
#=================================================
@@ -29,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