From 3b4e2dd10f60fcba38a19185910e3137485b12b3 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 2 Feb 2024 20:40:37 +0100 Subject: [PATCH] Post-install notification and backup boot config --- doc/POST_INSTALL.md | 3 +++ scripts/install | 9 +-------- 2 files changed, 4 insertions(+), 8 deletions(-) create mode 100644 doc/POST_INSTALL.md diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..81db4b1 --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1,3 @@ +Your device boot configuration has been updated to enable the hardware watchdog. + +Please reboot it. diff --git a/scripts/install b/scripts/install index 1cf9080..2ea9cb1 100644 --- a/scripts/install +++ b/scripts/install @@ -17,10 +17,9 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Adding system configurations related to $app..." -reboot_required=false if [[ $(grep -ic "Raspberry Pi" /proc/cpuinfo) -ge 1 && $(grep -ic "dtparam=watchdog=on" /boot/config.txt) -eq 0 ]]; then + cp /boot/config.txt "/boot/config.bak$(date '+%y%m%dT%H%M%S')" echo "dtparam=watchdog=on" >> /boot/config.txt - reboot_required=true fi yunohost service add $app @@ -50,10 +49,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" # END OF SCRIPT #================================================= -if [ $reboot_required = true ]; then - echo "Your device boot configuration has been updated to enable the hardware watchdog. Please reboot it." > ../doc/POST_INSTALL.md -else - rm -f ../doc/POST_INSTALL.md -fi - ynh_script_progression --message="Installation of $app completed" --last