base-files: shinit: properly handle dashes in service names
[openwrt/staging/dedeckeh.git] / package / base-files / files / etc / shinit
index 0a1ebcc832deebd91b85368768aa38319425bc0b..6b682d8769dfa78200bdc980fa746fe5f5bd204d 100644 (file)
@@ -22,7 +22,7 @@ service() {
                        printf "%-30s\t%10s\t%10s\n"  "$F" \
                        $( $($F enabled) && echo "enabled" || echo "disabled" ) \
                        $( [ "$(ubus call service list "{ 'verbose': true, 'name': '$(basename $F)' }" \
-                       | jsonfilter -q -e "@.$(basename $F).instances[*].running" | uniq)" = "true" ] \
+                       | jsonfilter -q -e "@['$(basename $F)'].instances[*].running" | uniq)" = "true" ] \
                        && echo "running" || echo "stopped" )
                done;
                return 1