2024-10-28 09:32:24 +03:00
|
|
|
custom_runner()
|
|
|
|
{
|
|
|
|
# $1 - function name
|
|
|
|
# $2+ - params
|
|
|
|
|
2024-12-09 11:04:13 +03:00
|
|
|
[ "$DISABLE_CUSTOM" = 1 ] && return 0
|
|
|
|
|
2024-10-28 09:32:24 +03:00
|
|
|
local n script FUNC=$1
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
[ -d "$CUSTOM_DIR/custom.d" ] && {
|
2024-10-25 14:29:47 +03:00
|
|
|
dir_is_not_empty "$CUSTOM_DIR/custom.d" && {
|
2024-10-28 09:32:24 +03:00
|
|
|
for script in "$CUSTOM_DIR/custom.d/"*; do
|
2024-10-13 13:25:19 +03:00
|
|
|
[ -f "$script" ] || continue
|
2024-10-28 09:32:24 +03:00
|
|
|
unset -f $FUNC
|
|
|
|
. "$script"
|
|
|
|
existf $FUNC && $FUNC "$@"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-10-12 21:28:51 +03:00
|
|
|
|
|
|
|
alloc_tpws_port()
|
|
|
|
{
|
|
|
|
# $1 - target var name
|
|
|
|
alloc_num NUMPOOL_TPWS_PORT $1 910 979
|
|
|
|
}
|
|
|
|
alloc_qnum()
|
|
|
|
{
|
|
|
|
# $1 - target var name
|
|
|
|
alloc_num NUMPOOL_QNUM $1 65400 65499
|
|
|
|
}
|
|
|
|
alloc_dnum()
|
|
|
|
{
|
|
|
|
# alloc daemon number
|
|
|
|
# $1 - target var name
|
|
|
|
alloc_num NUMPOOL_DNUM $1 1000 1999
|
|
|
|
}
|