diff --git a/hooks/conf_regen/03-ssh b/hooks/conf_regen/03-ssh
index ef9bbfc82b..27accf6eb4 100755
--- a/hooks/conf_regen/03-ssh
+++ b/hooks/conf_regen/03-ssh
@@ -20,7 +20,9 @@
set -e
-. /usr/share/yunohost/helpers
+# Source YNH helpers
+# shellcheck source=../../helpers/helpers
+source /usr/share/yunohost/helpers
do_pre_regen() {
pending_dir=$1
@@ -44,6 +46,7 @@ do_post_regen() {
regen_conf_files=$1
# If no file changed, there's nothing to do
+
[[ -n "$regen_conf_files" ]] || return 0
# Enforce permissions for /etc/ssh/sshd_config
@@ -53,4 +56,4 @@ do_post_regen() {
systemctl restart ssh
}
-do_$1_regen ${@:2}
+"do_$1_regen" "${@:2}"
diff --git a/hooks/conf_regen/15-nginx b/hooks/conf_regen/15-nginx
index 93c98b7dbf..5ac01bb855 100755
--- a/hooks/conf_regen/15-nginx
+++ b/hooks/conf_regen/15-nginx
@@ -18,9 +18,12 @@
# along with this program. If not, see .
#
+# Exit hook on subcommand error or unset variable
set -e
-. /usr/share/yunohost/helpers
+# Source YNH helpers
+# shellcheck source=../../helpers/helpers
+source /usr/share/yunohost/helpers
do_base_regen() {
@@ -188,4 +191,4 @@ do_post_regen() {
}
}
-do_$1_regen ${@:2}
+"do_$1_regen" "${@:2}"
diff --git a/hooks/conf_regen/19-postfix b/hooks/conf_regen/19-postfix
index 3ff0d06eaa..9796eaa840 100755
--- a/hooks/conf_regen/19-postfix
+++ b/hooks/conf_regen/19-postfix
@@ -18,9 +18,12 @@
# along with this program. If not, see .
#
+# Exit hook on subcommand error or unset variable
set -e
-. /usr/share/yunohost/helpers
+# Source YNH helpers
+# shellcheck source=../../helpers/helpers
+source /usr/share/yunohost/helpers
do_pre_regen() {
pending_dir=$1
@@ -123,4 +126,4 @@ do_post_regen() {
}
-do_$1_regen ${@:2}
+"do_$1_regen" "${@:2}"
diff --git a/hooks/conf_regen/43-dnsmasq b/hooks/conf_regen/43-dnsmasq
index b416266277..e1567c3afa 100755
--- a/hooks/conf_regen/43-dnsmasq
+++ b/hooks/conf_regen/43-dnsmasq
@@ -18,8 +18,12 @@
# along with this program. If not, see .
#
+# Exit hook on subcommand error or unset variable
set -e
-. /usr/share/yunohost/helpers
+
+# Source YNH helpers
+# shellcheck source=../../helpers/helpers
+source /usr/share/yunohost/helpers
do_pre_regen() {
pending_dir=$1
@@ -111,4 +115,4 @@ do_post_regen() {
systemctl restart dnsmasq
}
-do_$1_regen ${@:2}
+"do_$1_regen" "${@:2}"