metrics.sh: Prevent unbound variable when reloading metrics config

This commit is contained in:
thecalcaholic 2022-07-28 19:48:52 +02:00
parent baae501f3c
commit ca7fc4d7cf

View File

@ -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