diff --git a/self-diagnostics/Makefile b/self-diagnostics/Makefile index 801ae836e..348ceb2aa 100644 --- a/self-diagnostics/Makefile +++ b/self-diagnostics/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=self-diagnostics -PKG_VERSION:=1.0.8 +PKG_VERSION:=1.0.9 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0-only diff --git a/self-diagnostics/files/usr/libexec/rpcd/self-diagnostics b/self-diagnostics/files/usr/libexec/rpcd/self-diagnostics index 7bc92a0f5..1952282b2 100755 --- a/self-diagnostics/files/usr/libexec/rpcd/self-diagnostics +++ b/self-diagnostics/files/usr/libexec/rpcd/self-diagnostics @@ -11,17 +11,28 @@ case "$1" in case "$2" in generate) read -t 1 -r input + local out json_load "${input}" json_get_var modules modules if [ -z "${modules}" ]; then - ${BIN} -j + out="$(${BIN} -j)" else - ${BIN} -j -m "${modules}" + out="$(${BIN} -j -m "${modules}")" + fi + if [ -z "${out}" ]; then + echo '{}' + else + echo "${out}" fi ;; list) - ${BIN} -j -l + out="$(${BIN} -j -l)" + if [ -z "${out}" ]; then + echo '{}' + else + echo "${out}" + fi ;; esac ;;