From ca7fc4d7cfdb06d8c97db86e602a641acc89d811 Mon Sep 17 00:00:00 2001 From: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com> Date: Thu, 28 Jul 2022 19:48:52 +0200 Subject: [PATCH] metrics.sh: Prevent unbound variable when reloading metrics config --- bin/ncp/SYSTEM/metrics.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ncp/SYSTEM/metrics.sh b/bin/ncp/SYSTEM/metrics.sh index 7efb2b4a..3f9ca20e 100644 --- a/bin/ncp/SYSTEM/metrics.sh +++ b/bin/ncp/SYSTEM/metrics.sh @@ -27,6 +27,7 @@ tmpl_metrics_enabled() { } reload_metrics_config() { + set +u is_supported || return 0 install_template ncp-metrics.cfg.sh "/usr/local/etc/ncp-metrics.cfg" || { @@ -48,7 +49,7 @@ metrics_services() { if [[ "$cmd" =~ (start|stop|restart|reload|status) ]] then - if ! is_docker && ! [[ -d /run/systemd/system ]] + if ! is_docker && ! [[ -d /run/systemd/system ]] then echo "Probably running in chroot. Ignoring 'metrics_services $cmd'..." return 0