Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
30
package/system/procd/files/service
Normal file
30
package/system/procd/files/service
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
main() {
|
||||
local service="$1"
|
||||
shift
|
||||
|
||||
local boot status
|
||||
|
||||
if [ -f "/etc/init.d/${service}" ]; then
|
||||
/etc/init.d/"${service}" "$@"
|
||||
exit "$?"
|
||||
fi
|
||||
|
||||
if [ -n "$service" ]; then
|
||||
echo "Service \"$service\" not found:"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Usage: $(basename "$0") <service> [command]"
|
||||
for service in /etc/init.d/* ; do
|
||||
boot="$($service enabled && echo "enabled" || echo "disabled" )"
|
||||
status="$( [ "$(ubus call service list "{ 'verbose': true, 'name': '$(basename "$service")' }" \
|
||||
| jsonfilter -q -e "@['$(basename "$service")'].instances[*].running" | uniq)" = "true" ] \
|
||||
&& echo "running" || echo "stopped" )"
|
||||
|
||||
printf "%-30s\\t%10s\\t%10s\\n" "$service" "$boot" "$status"
|
||||
done
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user