<div dir="ltr">I've been using something similar on my system and propose the following patch (first submission to the list, be gentle ;)):<div><br></div><div>diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile<br>index 0beff1608f..e8350cfd6a 100644<br>--- a/package/base-files/files/etc/profile<br>+++ b/package/base-files/files/etc/profile<br>@@ -38,3 +38,24 @@ in order to prevent unauthorized SSH logins.<br> --------------------------------------------------<br> EOF<br> fi<br>+<br>+service() {<br>+        if [ "$1" = "list-enabled" ]; then<br>+                for F in /etc/init.d/* ; do<br>+                        $F enabled && echo "$F enabled"<br>+                done;<br>+        elif [ "$1" = "list-disabled" ]; then<br>+                for F in /etc/init.d/* ; do<br>+                        $F enabled || echo "$F disabled"<br>+                done;<br>+        elif [ -f "/etc/init.d/$1" ]; then<br>+                /etc/init.d/$@<br>+        else<br>+                echo "Usage: service list-disabled|list-enabled|<service> [command]"<br>+                if [ -n "$1" ]; then<br>+                        echo "service "'"'"$1"'"'" not found, the following services are available:"<br>+                        ls "/etc/init.d"<br>+                fi<br>+                return 1<br>+        fi<br>+}<br>diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common<br>index 7c11544405..c44614d757 100755<br>--- a/package/base-files/files/etc/rc.common<br>+++ b/package/base-files/files/etc/rc.common<br>@@ -67,13 +67,14 @@ help() {<br> Syntax: $initscript [command]<br> <br> Available commands:<br>-     start   Start the service<br>-    stop    Stop the service<br>-     restart Restart the service<br>-  reload  Reload configuration files (or restart if service does not implement reload)<br>- enable  Enable service autostart<br>-     disable Disable service autostart<br>-    enabled Check if service is started on boot<br>+  start           Start the service<br>+    stop            Stop the service<br>+     restart         Restart the service<br>+  reload          Reload configuration files (or restart if service does not implement reload)<br>+ enable          Enable service autostart<br>+     disable         Disable service autostart<br>+    enabled         Check if service is started on boot<br>+  status-ubus     Show ubus info for the service<br> $EXTRA_HELP<br> EOF<br> }<br>@@ -165,6 +166,13 @@ ${EXTRA_HELP}"<br>  }<br> }<br> <br>-ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"<br>-list_contains ALL_COMMANDS "$action" || action=help<br>+status_ubus() {<br>+     name="$(basename "${initscript}")"<br>+       /bin/ubus call service list "{'name': '$name'}"<br>+    return 0<br>+}<br>+<br>+ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends status-ubus ${EXTRA_COMMANDS}"<br>+list_contains ALL_COMMANDS "$action" && action="${action/-/_}" || action=help<br> $action "$@"<br>+<br></div><div><br></div></div>