libs/core: Allow the use of commands with arguments or of multiple commands for exec in /etc/config/ucitrack
This commit is contained in:
parent
cbdf1e095c
commit
1d70d03c08
1 changed files with 9 additions and 4 deletions
|
@ -13,10 +13,15 @@ apply_config() {
|
||||||
}
|
}
|
||||||
|
|
||||||
reload_exec() {
|
reload_exec() {
|
||||||
[ -x $2 ] && {
|
local service="$1"
|
||||||
echo "Reloading $1... "
|
local ok="$3"
|
||||||
$2 >/dev/null 2>&1
|
set -- $2
|
||||||
[ -n "$3" -a "$?" != "$3" ] && echo '!!! Failed to reload' $1 '!!!'
|
local cmd="$1"; shift
|
||||||
|
|
||||||
|
[ -x "$cmd" ] && {
|
||||||
|
echo "Reloading $service... "
|
||||||
|
( $cmd "$@" ) 2>/dev/null 1>&2
|
||||||
|
[ -n "$ok" -a "$?" != "$ok" ] && echo '!!! Failed to reload' $service '!!!'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue