Skip to content

Commit

Permalink
hooks/conf_regen: Fix some shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamandar committed Dec 21, 2024
1 parent f841bca commit d873ae0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
7 changes: 5 additions & 2 deletions hooks/conf_regen/03-ssh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -53,4 +56,4 @@ do_post_regen() {
systemctl restart ssh
}

do_$1_regen ${@:2}
"do_$1_regen" "${@:2}"
7 changes: 5 additions & 2 deletions hooks/conf_regen/15-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# 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() {

Expand Down Expand Up @@ -188,4 +191,4 @@ do_post_regen() {
}
}

do_$1_regen ${@:2}
"do_$1_regen" "${@:2}"
7 changes: 5 additions & 2 deletions hooks/conf_regen/19-postfix
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# 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
Expand Down Expand Up @@ -123,4 +126,4 @@ do_post_regen() {

}

do_$1_regen ${@:2}
"do_$1_regen" "${@:2}"
8 changes: 6 additions & 2 deletions hooks/conf_regen/43-dnsmasq
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

# 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
Expand Down Expand Up @@ -111,4 +115,4 @@ do_post_regen() {
systemctl restart dnsmasq
}

do_$1_regen ${@:2}
"do_$1_regen" "${@:2}"

0 comments on commit d873ae0

Please sign in to comment.