9 if [ -f "/etc/init.d/${service}" ]; then
10 /etc
/init.d
/"${service}" "${cmd}"
14 if [ -n "$service" ]; then
15 echo "Service \"$1\" not found:"
19 echo "Usage: $(basename "$0") <service> [command]"
20 for service
in /etc
/init.d
/* ; do
21 boot
="$($service enabled && echo "enabled
" || echo "disabled
" )"
22 status
="$( [ "$
(ubus call service list
"{ 'verbose': true, 'name': '$(basename "$service")' }" \
23 | jsonfilter
-q -e "@['$(basename "$service")'].instances[*].running" |
uniq)" = "true
" ] \
24 && echo "running
" || echo "stopped
" )"
26 printf "%-30s\\t%10s\\t%10s\\n" "$service" "$boot" "$status"