diff --git a/data/hooks/backup/21-conf_ynh_certs b/data/hooks/backup/21-conf_ynh_certs new file mode 100644 index 000000000..a3912a995 --- /dev/null +++ b/data/hooks/backup/21-conf_ynh_certs @@ -0,0 +1,13 @@ +#!/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/certs" + +# Backup certificates +ynh_backup "/etc/yunohost/certs" "$backup_dir" diff --git a/data/hooks/restore/21-conf_ynh_certs b/data/hooks/restore/21-conf_ynh_certs new file mode 100644 index 000000000..983bfb5a1 --- /dev/null +++ b/data/hooks/restore/21-conf_ynh_certs @@ -0,0 +1,7 @@ +backup_dir="$1/conf/ynh/certs" + +mkdir -p /etc/yunohost/certs/ + +cp -a $backup_dir/. /etc/yunohost/certs/ +service nginx reload +service metronome reload