mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge firewall, dkim and dyndns backup hook into ynh_settings
This commit is contained in:
parent
c089d1bdcd
commit
82784dc45d
8 changed files with 6 additions and 54 deletions
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Exit hook on subcommand error or unset variable
|
||||
set -eu
|
||||
|
||||
# Source YNH helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
# Backup destination
|
||||
backup_dir="${1}/conf/ynh/firewall"
|
||||
|
||||
# Backup the configuration
|
||||
ynh_backup "/etc/yunohost/firewall.yml" "${backup_dir}/firewall.yml"
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
ynh_abort_if_errors
|
||||
YNH_CWD="${YNH_BACKUP_DIR%/}/conf/dkim"
|
||||
mkdir -p "$YNH_CWD"
|
||||
cd "$YNH_CWD"
|
||||
|
||||
ynh_backup --src_path="/etc/dkim"
|
|
@ -10,5 +10,8 @@ source /usr/share/yunohost/helpers
|
|||
backup_dir="${1}/conf/ynh"
|
||||
|
||||
# Backup the configuration
|
||||
ynh_backup "/etc/yunohost/firewall.yml" "${backup_dir}/firewall.yml"
|
||||
ynh_backup "/etc/yunohost/current_host" "${backup_dir}/current_host"
|
||||
[ ! -e "/etc/yunohost/settings.json" ] || ynh_backup "/etc/yunohost/settings.json" "${backup_dir}/settings.json"
|
||||
[ ! -d "/etc/yunohost/dyndns" ] || ynh_backup "/etc/yunohost/dyndns" "${backup_dir}/dyndns"
|
||||
[ ! -d "/etc/dkim" ] || ynh_backup "/etc/dkim" "${backup_dir}/dkim"
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
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
|
||||
ynh_exec_warn_less ynh_backup --src_path="/etc/yunohost/dyndns" --not_mandatory
|
|
@ -1,4 +0,0 @@
|
|||
backup_dir="$1/conf/ynh/firewall"
|
||||
|
||||
cp -a $backup_dir/. /etc/yunohost
|
||||
yunohost firewall reload
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
backup_dir="$1/conf/dkim"
|
||||
|
||||
cp -a $backup_dir/etc/dkim/. /etc/dkim
|
||||
|
||||
chown -R root:root /etc/dkim
|
||||
chown _rspamd:root /etc/dkim
|
||||
chown _rspamd:root /etc/dkim/*.mail.key
|
|
@ -1,4 +1,7 @@
|
|||
backup_dir="$1/conf/ynh"
|
||||
|
||||
cp -a "${backup_dir}/current_host" /etc/yunohost/current_host
|
||||
cp -a "${backup_dir}/firewall.yml" /etc/yunohost/firewall.yml
|
||||
[ ! -e "${backup_dir}/settings.json" ] || cp -a "${backup_dir}/settings.json" "/etc/yunohost/settings.json"
|
||||
[ ! -d "${backup_dir}/dyndns" ] || cp -raT "${backup_dir}/dyndns" "/etc/yunohost/dyndns"
|
||||
[ ! -d "${backup_dir}/dkim" ] || cp -raT "${backup_dir}/dkim" "/etc/dkim"
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#!/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
|
Loading…
Add table
Reference in a new issue