diff options
author | thecalcaholic <6317548+theCalcaholic@users.noreply.github.com> | 2022-07-28 20:48:52 +0300 |
---|---|---|
committer | thecalcaholic <6317548+theCalcaholic@users.noreply.github.com> | 2022-07-28 20:48:52 +0300 |
commit | ca7fc4d7cfdb06d8c97db86e602a641acc89d811 (patch) | |
tree | e996e02d388ec988a8f2d0a3479cd5a7260e2f2c | |
parent | baae501f3c680d2ac99f27777d20ea320691f428 (diff) |
metrics.sh: Prevent unbound variable when reloading metrics configfix/ncdatadir-unbound-variable
-rw-r--r-- | bin/ncp/SYSTEM/metrics.sh | 3 |
1 files changed, 2 insertions, 1 deletions
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 |