1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/watchdog_ynh.git synced 2024-06-22 05:42:53 +02:00

Post-install notification and backup boot config

This commit is contained in:
tituspijean 2024-02-02 20:40:37 +01:00
parent 5b604d52cf
commit 3b4e2dd10f
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
2 changed files with 4 additions and 8 deletions

3
doc/POST_INSTALL.md Normal file
View file

@ -0,0 +1,3 @@
Your device boot configuration has been updated to enable the hardware watchdog.
Please reboot it.

View file

@ -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