From 8b53d6562e8a948dcda824ff2480d0eb2fa66f87 Mon Sep 17 00:00:00 2001 From: ljf Date: Wed, 9 Dec 2020 01:31:17 +0100 Subject: [PATCH 1/2] [fix] Add Dyndns domains keys to backup --- data/hooks/backup/42-conf_ynh_dyndns | 10 ++++++++++ data/hooks/restore/42-conf_ynh_dyndns | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 data/hooks/backup/42-conf_ynh_dyndns create mode 100644 data/hooks/restore/42-conf_ynh_dyndns diff --git a/data/hooks/backup/42-conf_ynh_dyndns b/data/hooks/backup/42-conf_ynh_dyndns new file mode 100644 index 000000000..776162ff0 --- /dev/null +++ b/data/hooks/backup/42-conf_ynh_dyndns @@ -0,0 +1,10 @@ +#!/bin/bash + +source /usr/share/yunohost/helpers +ynh_abort_if_errors +YNH_CWD="${YNH_BACKUP_DIR%/}/conf/ynh/dyndns" +cd "$YNH_CWD" + +# Backup the configuration +ynh_backup --src_path="/etc/yunohost/dyndns" --not_mandatory +ynh_backup --src_path="/etc/cron.d/yunohost-dyndns" --not_mandatory diff --git a/data/hooks/restore/42-conf_ynh_dyndns b/data/hooks/restore/42-conf_ynh_dyndns new file mode 100644 index 000000000..d16d7a67c --- /dev/null +++ b/data/hooks/restore/42-conf_ynh_dyndns @@ -0,0 +1,10 @@ +#!/bin/bash + +source /usr/share/yunohost/helpers +ynh_abort_if_errors +YNH_CWD="${YNH_BACKUP_DIR%/}/conf/ynh/dyndns" +cd "$YNH_CWD" + +# Restore file if exists +ynh_restore_file --origin_path="/etc/yunohost/dyndns" --not_mandatory +ynh_restore_file --origin_path="/etc/cron.d/yunohost-dyndns" --not_mandatory From 60d838843eeb9b2ed94b19e847fc43ee30e0358b Mon Sep 17 00:00:00 2001 From: ljf Date: Wed, 9 Dec 2020 02:36:39 +0100 Subject: [PATCH 2/2] [fix] Missing mkdir --- data/hooks/backup/42-conf_ynh_dyndns | 1 + 1 file changed, 1 insertion(+) diff --git a/data/hooks/backup/42-conf_ynh_dyndns b/data/hooks/backup/42-conf_ynh_dyndns index 776162ff0..323464108 100644 --- a/data/hooks/backup/42-conf_ynh_dyndns +++ b/data/hooks/backup/42-conf_ynh_dyndns @@ -3,6 +3,7 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors YNH_CWD="${YNH_BACKUP_DIR%/}/conf/ynh/dyndns" +mkdir -p $YNH_CWD cd "$YNH_CWD" # Backup the configuration