mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 23:42:43 +00:00
base-files: implement generic service_running
DRY is good, otherwise we're going to suffer with a copy&paste disease in the init scripts. Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
parent
a33d60c896
commit
ed5b9129d7
@ -95,7 +95,9 @@ service_data() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
service_running() {
|
service_running() {
|
||||||
return 0
|
local service="${1:-$(basename $initscript)}"
|
||||||
|
local instance="${2:-*}"
|
||||||
|
procd_running "$service" "$instance" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
${INIT_TRACE:+set -x}
|
${INIT_TRACE:+set -x}
|
||||||
@ -104,6 +106,9 @@ ${INIT_TRACE:+set -x}
|
|||||||
|
|
||||||
[ -n "$USE_PROCD" ] && {
|
[ -n "$USE_PROCD" ] && {
|
||||||
EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
|
EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
|
||||||
|
EXTRA_HELP="\
|
||||||
|
running Check if service is running
|
||||||
|
"
|
||||||
|
|
||||||
. $IPKG_INSTROOT/lib/functions/procd.sh
|
. $IPKG_INSTROOT/lib/functions/procd.sh
|
||||||
basescript=$(readlink "$initscript")
|
basescript=$(readlink "$initscript")
|
||||||
|
Loading…
Reference in New Issue
Block a user