✨ Sync 2026-04-11 23:43:05

This commit is contained in:
github-actions[bot] committed 2026-04-11 23:43:05 +08:00
1 parent 7ecb8c8453
commit 198ffd908e
14 files changed
+233 -150

No files matched your search

@@ -134,16 +134,10 @@ run_xray() {
set_cache_var "node_${node}_direct_nftset6" "${direct_nftset6}"
}
}
json_add_string "direct_dns_udp_port" "${DIRECT_DNS_UDP_PORT}"
json_add_string "direct_dns_udp_server" "${DIRECT_DNS_UDP_SERVER}"
json_add_string "direct_dns_query_strategy" "${direct_dns_query_strategy}"
[ "$remote_fakedns" = "1" ] && {
json_add_string "remote_dns_fake" "1"
json_add_string "remote_dns_fake_strategy" "${remote_dns_query_strategy}"
}
local _json1_arg="$(json_dump)"
json_init
case "$remote_dns_protocol" in
udp)
local _dns=$(get_first_dns remote_dns_udp_server 53 | sed 's/#/:/g')
@@ -178,20 +172,10 @@ run_xray() {
[ -n "$remote_dns_detour" ] && json_add_string "remote_dns_detour" "${remote_dns_detour}"
[ -n "$remote_dns_query_strategy" ] && json_add_string "remote_dns_query_strategy" "${remote_dns_query_strategy}"
[ -n "$remote_dns_client_ip" ] && json_add_string "remote_dns_client_ip" "${remote_dns_client_ip}"
local _json2_arg="$(json_dump)"
local _json2_keys key
json_load "${_json2_arg}"
json_get_keys _json2_keys
for key in ${_json2_keys}; do
json_get_var "_json2_$key" "$key"
done
json_load "${_json1_arg}"
for key in ${_json2_keys}; do
eval "local _v=\$_json2_$key"
json_add_string "$key" "$_v"
done
}
json_add_string "direct_dns_udp_port" "${DIRECT_DNS_UDP_PORT}"
json_add_string "direct_dns_udp_server" "${DIRECT_DNS_UDP_SERVER}"
json_add_string "direct_dns_query_strategy" "${direct_dns_query_strategy}"
[ -n "${redir_port}" ] && {
json_add_string "redir_port" "${redir_port}"
@@ -209,7 +193,7 @@ run_xray() {
$XRAY_BIN run -test -c "$config_file" > $test_log_file; local status=$?
if [ "${status}" == 0 ]; then
ln_run "$XRAY_BIN" xray $log_file run -c "$config_file"
ln_run ${QUEUE_RUN} "$XRAY_BIN" xray $log_file run -c "$config_file"
else
_error_log_file=$test_log_file
return ${status}
@@ -289,9 +273,6 @@ run_singbox() {
set_cache_var "node_${node}_direct_nftset6" "${direct_nftset6}"
}
}
json_add_string "direct_dns_udp_port" "${DIRECT_DNS_UDP_PORT}"
json_add_string "direct_dns_udp_server" "${DIRECT_DNS_UDP_SERVER}"
json_add_string "direct_dns_query_strategy" "${direct_dns_query_strategy}"
case "$remote_dns_protocol" in
udp|\
@@ -339,6 +320,9 @@ run_singbox() {
[ -n "$dns_cache" ] && json_add_string "dns_cache" "${dns_cache}"
[ "$remote_fakedns" = "1" ] && json_add_string "remote_dns_fake" "1"
}
json_add_string "direct_dns_udp_port" "${DIRECT_DNS_UDP_PORT}"
json_add_string "direct_dns_udp_server" "${DIRECT_DNS_UDP_SERVER}"
json_add_string "direct_dns_query_strategy" "${direct_dns_query_strategy}"
[ -n "${redir_port}" ] && {
json_add_string "redir_port" "${redir_port}"
@@ -356,7 +340,7 @@ run_singbox() {
$SINGBOX_BIN check -c "$config_file" > $test_log_file 2>&1; local status=$?
if [ "${status}" == 0 ]; then
ln_run "$SINGBOX_BIN" "sing-box" "${log_file}" run -c "$config_file"
ln_run ${QUEUE_RUN} "$SINGBOX_BIN" "sing-box" "${log_file}" run -c "$config_file"
else
_error_log_file=$test_log_file
return ${status}
@@ -435,9 +419,12 @@ run_socks() {
json_add_string "flag" "SOCKS_${flag}"
json_add_string "local_socks_address" "${bind}"
json_add_string "local_socks_port" "${socks_port}"
json_add_string "direct_dns_udp_port" "${DIRECT_DNS_UDP_PORT}"
json_add_string "direct_dns_udp_server" "${DIRECT_DNS_UDP_SERVER}"
json_add_string "direct_dns_query_strategy" "${DIRECT_DNS_QUERY_STRATEGY}"
local _json_arg="$(json_dump)"
lua $UTIL_SINGBOX gen_config "${_json_arg}" > $config_file
[ -z "$no_run" ] && ln_run "$SINGBOX_BIN" "sing-box" /dev/null run -c "$config_file"
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "$SINGBOX_BIN" "sing-box" /dev/null run -c "$config_file"
;;
xray)
[ "$http_port" != "0" ] && {
@@ -454,9 +441,12 @@ run_socks() {
json_add_string "flag" "SOCKS_${flag}"
json_add_string "local_socks_address" "${bind}"
json_add_string "local_socks_port" "${socks_port}"
json_add_string "direct_dns_udp_port" "${DIRECT_DNS_UDP_PORT}"
json_add_string "direct_dns_udp_server" "${DIRECT_DNS_UDP_SERVER}"
json_add_string "direct_dns_query_strategy" "${DIRECT_DNS_QUERY_STRATEGY}"
local _json_arg="$(json_dump)"
lua $UTIL_XRAY gen_config "${_json_arg}" > $config_file
[ -z "$no_run" ] && ln_run "$XRAY_BIN" "xray" $log_file run -c "$config_file"
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "$XRAY_BIN" "xray" $log_file run -c "$config_file"
;;
naiveproxy)
json_add_string "local_addr" "${bind}"
@@ -464,14 +454,14 @@ run_socks() {
json_add_string "run_type" "socks"
local _json_arg="$(json_dump)"
lua $UTIL_NAIVE gen_config "${_json_arg}" > $config_file
[ -z "$no_run" ] && ln_run "$(first_type naive)" naive $log_file "$config_file"
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "$(first_type naive)" naive $log_file "$config_file"
;;
ssr)
json_add_string "local_addr" "${bind}"
json_add_string "local_port" "${socks_port}"
local _json_arg="$(json_dump)"
lua $UTIL_SS gen_config "${_json_arg}" > $config_file
[ -z "$no_run" ] && ln_run "$(first_type ssr-local)" "ssr-local" $log_file -c "$config_file" -v -u
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "$(first_type ssr-local)" "ssr-local" $log_file -c "$config_file" -v -u
;;
ss)
json_add_string "local_addr" "${bind}"
@@ -483,7 +473,7 @@ run_socks() {
}
local _json_arg="$(json_dump)"
lua $UTIL_SS gen_config "${_json_arg}" > $config_file
[ -z "$no_run" ] && ln_run "$(first_type ss-local)" "ss-local" $log_file -c "$config_file" -v
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "$(first_type ss-local)" "ss-local" $log_file -c "$config_file" -v
;;
ss-rust)
json_add_string "local_socks_address" "${bind}"
@@ -500,7 +490,7 @@ run_socks() {
}
local _json_arg="$(json_dump)"
lua $UTIL_SS gen_config "${_json_arg}" > $config_file
[ -z "$no_run" ] && ln_run "$(first_type sslocal)" "sslocal" $log_file -c "$config_file" -v
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "$(first_type sslocal)" "sslocal" $log_file -c "$config_file" -v
;;
hysteria2)
json_add_string "local_socks_address" "${bind}"
@@ -513,14 +503,14 @@ run_socks() {
}
local _json_arg="$(json_dump)"
lua $UTIL_HYSTERIA2 gen_config "${_json_arg}" > $config_file
[ -z "$no_run" ] && ln_run "$(first_type $(config_t_get global_app hysteria_file))" "hysteria" $log_file -c "$config_file" client
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "$(first_type $(config_t_get global_app hysteria_file))" "hysteria" $log_file -c "$config_file" client
;;
tuic)
json_add_string "local_addr" "${bind}"
json_add_string "local_port" "${socks_port}"
local _json_arg="$(json_dump)"
lua $UTIL_TUIC gen_config "${_json_arg}" > $config_file
[ -z "$no_run" ] && ln_run "$(first_type tuic-client)" "tuic-client" $log_file -c "$config_file"
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "$(first_type tuic-client)" "tuic-client" $log_file -c "$config_file"
;;
esac
@@ -545,7 +535,7 @@ run_socks() {
fi
[ -n "${bin}" ] && [ -n "${util}" ] && {
lua ${util} gen_proto_config "${_json_arg}" > ${http_config_file}
[ -z "$no_run" ] && ln_run "${bin}" ${type} /dev/null run -c ${http_config_file}
[ -z "$no_run" ] && ln_run ${QUEUE_RUN} "${bin}" ${type} /dev/null run -c ${http_config_file}
}
unset bin util
}
@@ -699,16 +689,16 @@ run_front_dns() {
}
local _json_arg="$(json_dump)"
local preferred_core=""
[ -n "${XRAY_BIN}" ] && preferred_core="xray"
[ -n "${SINGBOX_BIN}" ] && preferred_core="sing-box"
local prefer_core=""
[ -n "${XRAY_BIN}" ] && prefer_core="xray"
[ -n "${SINGBOX_BIN}" ] && prefer_core="sing-box"
if [ "${preferred_core}" = "xray" ]; then
if [ "${prefer_core}" = "xray" ]; then
lua $UTIL_XRAY gen_front_dns_config "${_json_arg}" > $config_file
ln_run "$XRAY_BIN" "xray" "${log_file}" run -c "$config_file"
elif [ "${preferred_core}" = "sing-box" ]; then
ln_run 0 "$XRAY_BIN" "xray" "${log_file}" run -c "$config_file"
elif [ "${prefer_core}" = "sing-box" ]; then
lua $UTIL_SINGBOX gen_front_dns_config "${_json_arg}" > $config_file
ln_run "$SINGBOX_BIN" "sing-box" "${log_file}" run -c "$config_file"
ln_run 0 "$SINGBOX_BIN" "sing-box" "${log_file}" run -c "$config_file"
else
return 1
fi
@@ -743,7 +733,7 @@ run_global_dnsmasq() {
json_add_string "DNSMASQ_CONF" "${DIRECT_DNSMASQ_CONF}"
json_add_string "TMP_DNSMASQ_PATH" "${DIRECT_DNSMASQ_CONF_PATH}"
lua $APP_PATH/helper_dnsmasq.lua copy_instance "$(json_dump)"
ln_run "$(first_type dnsmasq)" "dnsmasq_direct" "/dev/null" -C ${DIRECT_DNSMASQ_CONF} -x ${GLOBAL_ACL_PATH}/direct_dnsmasq.pid
ln_run 0 "$(first_type dnsmasq)" "dnsmasq_direct" "/dev/null" -C ${DIRECT_DNSMASQ_CONF} -x ${GLOBAL_ACL_PATH}/direct_dnsmasq.pid
set_cache_var "DIRECT_DNSMASQ_PORT" "${DIRECT_DNSMASQ_PORT}"
}
@@ -769,7 +759,7 @@ run_global_dnsmasq() {
else
#Run a copy dnsmasq instance, DNS hijack for that need proxy devices.
GLOBAL_DNSMASQ_PORT=$(get_new_port 11400)
run_copy_dnsmasq flag="default" listen_port=$GLOBAL_DNSMASQ_PORT tun_dns="${DNSMASQ_TUN_DNS}"
run_copy_dnsmasq flag="default" listen_port=$GLOBAL_DNSMASQ_PORT local_dns="${DNSMASQ_LOCAL_DNS}" tun_dns="${DNSMASQ_TUN_DNS}" default_dns="${DNSMASQ_DEFAULT_DNS}"
DNS_REDIRECT_PORT=${GLOBAL_DNSMASQ_PORT}
#dhcp.leases to hosts
$APP_PATH/lease2hosts.sh > /dev/null 2>&1 &
@@ -944,11 +934,11 @@ start_haproxy() {
haproxy_path=$TMP_PATH/haproxy
haproxy_conf="config.cfg"
lua $APP_PATH/haproxy.lua -path ${haproxy_path} -conf ${haproxy_conf} -dns ${LOCAL_DNS:-${AUTO_DNS}}
ln_run "$(first_type haproxy)" haproxy "/dev/null" -f "${haproxy_path}/${haproxy_conf}"
ln_run ${QUEUE_RUN} "$(first_type haproxy)" haproxy "/dev/null" -f "${haproxy_path}/${haproxy_conf}"
}
run_copy_dnsmasq() {
local flag listen_port tun_dns
local flag listen_port local_dns tun_dns default_dns
eval_set_val $@
local dnsmasq_conf=$TMP_ACL_PATH/$flag/dnsmasq.conf
local dnsmasq_conf_path=$TMP_ACL_PATH/$flag/dnsmasq.d
@@ -963,14 +953,14 @@ run_copy_dnsmasq() {
json_add_string "FLAG" "${flag}"
json_add_string "TMP_DNSMASQ_PATH" "${dnsmasq_conf_path}"
json_add_string "DNSMASQ_CONF_FILE" "${dnsmasq_conf}"
json_add_string "DEFAULT_DNS" "${AUTO_DNS}"
json_add_string "LOCAL_DNS" "${LOCAL_DNS:-${AUTO_DNS}}"
json_add_string "DEFAULT_DNS" "${default_dns}"
json_add_string "LOCAL_DNS" "${local_dns}"
json_add_string "TUN_DNS" "${tun_dns}"
json_add_string "NFTFLAG" "${nftflag:-0}"
json_add_string "NO_LOGIC_LOG" "${NO_LOGIC_LOG:-0}"
lua $APP_PATH/helper_dnsmasq.lua add_rule "$(json_dump)"
ln_run "$(first_type dnsmasq)" "dnsmasq_${flag}" "/dev/null" -C $dnsmasq_conf -x $TMP_ACL_PATH/$flag/dnsmasq.pid
ln_run 0 "$(first_type dnsmasq)" "dnsmasq_${flag}" "/dev/null" -C $dnsmasq_conf -x $TMP_ACL_PATH/$flag/dnsmasq.pid
set_cache_var "ACL_${flag}_dns_port" "${listen_port}"
}
@@ -1011,7 +1001,7 @@ run_ipset_chinadns_ng() {
group-upstream ${server_dns}
group-ipset ${vps_set_names}
EOF
ln_run "$(first_type chinadns-ng)" "chinadns-ng" "/dev/null" -C $config_file -v
ln_run 0 "$(first_type chinadns-ng)" "chinadns-ng" "/dev/null" -C $config_file -v
}
run_ipset_dnsmasq() {
@@ -1030,7 +1020,7 @@ run_ipset_dnsmasq() {
done
[ -n "${ipset}" ] && echo "ipset=${ipset}" >> $config_file
[ -n "${nftset}" ] && echo "nftset=${nftset}" >> $config_file
ln_run "$(first_type dnsmasq)" "dnsmasq" "/dev/null" -C $config_file
ln_run 0 "$(first_type dnsmasq)" "dnsmasq" "/dev/null" -C $config_file
}
acl_app() {
@@ -1154,7 +1144,7 @@ acl_app() {
fi
fi
dnsmasq_port=$(get_new_port $(expr $dnsmasq_port + 1))
run_copy_dnsmasq flag="$sid" listen_port=$dnsmasq_port tun_dns="127.0.0.1#${dns_port}"
run_copy_dnsmasq flag="$sid" listen_port=$dnsmasq_port local_dns="${LOCAL_DNS:-${AUTO_DNS}}" tun_dns="127.0.0.1#${dns_port}" default_dns="${AUTO_DNS}"
#dhcp.leases to hostsMore actions
$APP_PATH/lease2hosts.sh > /dev/null 2>&1 &
@@ -1177,7 +1167,6 @@ start() {
stop
}
mkdir -p /tmp/etc /tmp/log $TMP_PATH $TMP_BIN_PATH $TMP_SCRIPT_FUNC_PATH $TMP_ROUTE_PATH $TMP_ACL_PATH $TMP_PATH2
get_config
export V2RAY_LOCATION_ASSET=$(config_t_get global_rules v2ray_location_asset "/usr/share/v2ray/")
export XRAY_LOCATION_ASSET=$V2RAY_LOCATION_ASSET
export ENABLE_DEPRECATED_GEOSITE=true
@@ -1217,6 +1206,7 @@ start() {
sysctl -w net.bridge.bridge-nf-call-ip6tables=0 >/dev/null 2>&1
}
fi
run_process_queue
start_crontab
log_i18n 0 "Running complete!"
echolog "\n"
@@ -1346,15 +1336,21 @@ get_config() {
fi
set_cache_var GLOBAL_DNSMASQ_CONF ${DNSMASQ_CONF_DIR}/dnsmasq-${CONFIG}.conf
set_cache_var GLOBAL_DNSMASQ_CONF_PATH ${GLOBAL_ACL_PATH}/dnsmasq.d
QUEUE_RUN=1
}
get_config
arg1=$1
shift
case $arg1 in
run_socks)
QUEUE_RUN=0
run_socks $@
;;
socks_node_switch)
QUEUE_RUN=0
socks_node_switch $@
;;
start)
@@ -18,7 +18,6 @@ while [ "$ENABLED" -eq 1 ]; do
for filename in $(ls ${TMP_SCRIPT_FUNC_PATH} | grep -v "^_"); do
cmd=$(cat ${TMP_SCRIPT_FUNC_PATH}/${filename})
cmd_check=$(echo $cmd | awk -F '>' '{print $1}')
[ -n "$(echo $cmd_check | grep "dns2socks")" ] && cmd_check=$(echo $cmd_check | sed "s#:# #g")
icount=$(pgrep -f "$(echo $cmd_check)" | wc -l)
if [ $icount = 0 ]; then
#echo "${cmd} crashed, restarting." >> /tmp/log/passwall2.log
@@ -49,9 +49,9 @@ test_node() {
local _type=$(echo $(config_n_get ${node_id} type) | tr 'A-Z' 'a-z')
[ -n "${_type}" ] && {
local _tmp_port=$(get_new_port 48800 tcp,udp)
$APP_FILE run_socks flag="test_node_${node_id}" node=${node_id} bind=127.0.0.1 socks_port=${_tmp_port} config_file=test_node_${node_id}.json
NO_REC_PROCESS=1 $APP_FILE run_socks flag="test_node_${node_id}" node=${node_id} bind=127.0.0.1 socks_port=${_tmp_port} config_file=test_node_${node_id}.json
sleep 2s
local curlx="socks5h://127.0.0.1:${_tmp_port}"
sleep 1s
local _proxy_status=$(test_url "${probe_url}" ${retry_num} ${connect_timeout} "-x $curlx")
# Kill the SS plugin process
local pid_file="/tmp/etc/${CONFIG}/test_node_${node_id}_plugin.pid"
@@ -42,8 +42,7 @@ local core_has = {
["xray"] = has_xray, ["sing-box"] = has_singbox, ["shadowsocks-libev"] = has_ss,["shadowsocks-rust"] = has_ss_rust,
["hysteria2"] = has_hysteria2
}
local domain_strategy_default = uci:get(appname, "@global_subscribe[0]", "domain_strategy") or ""
local domain_strategy_node = ""
local domain_resolver, domain_resolver_dns, domain_resolver_dns_https, domain_strategy
local preproxy_node_group, to_node_group, chain_node_type = "", "", ""
-- Determine whether to filter node keywords
local filter_keyword_mode_default = uci:get(appname, "@global_subscribe[0]", "filter_keyword_mode") or "0"
@@ -1842,9 +1841,22 @@ local function update_node(manual)
if kkk ~= "group" or vvv ~= "default" then
uci:set(appname, cfgid, kkk, vvv)
end
-- Sing-Box Domain Strategy
if kkk == "type" and vvv == "sing-box" then
uci:set(appname, cfgid, "domain_strategy", domain_strategy_node)
-- Sing-Box Node Domain resolver
if kkk == "type" and (vvv == "Xray" or vvv == "sing-box") then
if domain_resolver then
uci:set(appname, cfgid, "domain_resolver", domain_resolver)
if domain_resolver_dns then
uci:set(appname, cfgid, "domain_resolver_dns", domain_resolver_dns)
elseif domain_resolver_dns_https then
uci:set(appname, cfgid, "domain_resolver_dns_https", domain_resolver_dns_https)
end
end
if domain_strategy then
if vvv == "sing-box" then
domain_strategy = (domain_strategy == "UseIPv4" and "ipv4_only") or (domain_strategy == "UseIPv6" and "ipv6_only") or domain_strategy
end
uci:set(appname, cfgid, "domain_strategy", domain_strategy)
end
end
-- Subscription Group Chain Agent
if chain_node_type ~= "" and kkk == "type" and (vvv == "Xray" or vvv == "sing-box") then
@@ -2059,12 +2071,11 @@ local execute = function()
if hysteria2_type ~= "global" and core_has[hysteria2_type] then
hysteria2_type_default = hysteria2_type
end
local domain_strategy = value.domain_strategy or "global"
if domain_strategy ~= "global" then
domain_strategy_node = domain_strategy
else
domain_strategy_node = domain_strategy_default
end
domain_resolver = value.domain_resolver
domain_resolver_dns = value.domain_resolver_dns
domain_resolver_dns_https = value.domain_resolver_dns_https
domain_strategy = (value.domain_strategy == "UseIPv4" or value.domain_strategy == "UseIPv6") and value.domain_strategy or nil
-- Subscription Group Chain Agent
local function valid_chain_node(node)
@@ -47,9 +47,9 @@ url_test_node() {
local _type=$(echo $(config_n_get ${node_id} type) | tr 'A-Z' 'a-z')
[ -n "${_type}" ] && {
local _tmp_port=$(get_new_port 48900 tcp,udp)
/usr/share/${CONFIG}/app.sh run_socks flag="url_test_${node_id}" node=${node_id} bind=127.0.0.1 socks_port=${_tmp_port} config_file=url_test_${node_id}.json
NO_REC_PROCESS=1 /usr/share/${CONFIG}/app.sh run_socks flag="url_test_${node_id}" node=${node_id} bind=127.0.0.1 socks_port=${_tmp_port} config_file=url_test_${node_id}.json
sleep 2s
local curlx="socks5h://127.0.0.1:${_tmp_port}"
sleep 1s
local url=$(config_t_get global_other url_test_url https://www.google.com/generate_204)
result=$(curl --connect-timeout 3 -o /dev/null -I -skL -w "%{http_code}:%{time_starttransfer}" -x $curlx "${url}")
pgrep -af "url_test_${node_id}" | awk '! /test\.sh/{print $1}' | xargs kill -9 >/dev/null 2>&1
@@ -13,6 +13,7 @@ TMP_BIN_PATH=${TMP_PATH}/bin
TMP_IFACE_PATH=${TMP_PATH}/iface
TMP_ROUTE_PATH=${TMP_PATH}/route
TMP_SCRIPT_FUNC_PATH=${TMP_PATH}/script_func
TMP_PROCESS_LIST_PATH=${TMP_PATH}/process_list
. /lib/functions/network.sh
@@ -69,6 +70,7 @@ set_cache_var() {
shift 1
local val="$@"
[ -n "${key}" ] && [ -n "${val}" ] && {
[ ! -d $TMP_PATH ] && mkdir -p $TMP_PATH
sed -i "/${key}=/d" $TMP_PATH/var >/dev/null 2>&1
echo "${key}=\"${val}\"" >> $TMP_PATH/var
eval ${key}=\"${val}\"
@@ -372,11 +374,12 @@ delete_ip2route() {
}
ln_run() {
local file_func=${1}
local ln_name=${2}
local output=${3}
local queue_run=${1}
local file_func=${2}
local ln_name=${3}
local output=${4}
shift 4;
shift 3;
if [ "${file_func%%/*}" != "${file_func}" ]; then
[ ! -L "${file_func}" ] && {
ln -s "${file_func}" "${TMP_BIN_PATH}/${ln_name}" >/dev/null 2>&1
@@ -386,16 +389,37 @@ ln_run() {
fi
#echo "${file_func} $*" >&2
[ -n "${file_func}" ] || log 1 "$(i18n "%s not found, unable to start..." "${ln_name}")"
[ "${queue_run}" == "1" ] && {
mkdir -p $TMP_PROCESS_LIST_PATH
process_count=$(ls $TMP_PROCESS_LIST_PATH | grep -v "^_" | wc -l)
process_count=$((process_count + 1))
echo "${file_func:-log 1 "${ln_name}"} $@ >${output}" > $TMP_PROCESS_LIST_PATH/$process_count
return
}
${file_func:-log 1 "${ln_name}"} "$@" >${output} 2>&1 &
local pid=${!}
#sleep 1s
#kill -0 ${pid} 2>/dev/null
#local status_code=${?}
[ -n "$NO_REC_PROCESS" ] && return
process_count=$(ls $TMP_SCRIPT_FUNC_PATH | grep -v "^_" | wc -l)
process_count=$((process_count + 1))
echo "${file_func:-log 1 "${ln_name}"} $@ >${output}" > $TMP_SCRIPT_FUNC_PATH/$process_count
#return ${status_code}
}
run_process_queue() {
[ -d ${TMP_PROCESS_LIST_PATH} ] && {
for filename in $(ls ${TMP_PROCESS_LIST_PATH}); do
cmd=$(cat ${TMP_PROCESS_LIST_PATH}/${filename})
cmd_check=$(echo $cmd | awk -F '>' '{print $1}')
icount=$(pgrep -f "$(echo $cmd_check)" | wc -l)
if [ $icount = 0 ]; then
eval $(echo "nohup ${cmd} 2>&1 &") >/dev/null 2>&1 &
fi
rm -rf ${TMP_PROCESS_LIST_PATH}/${filename}
done
}
rm -rf ${TMP_PROCESS_LIST_PATH}
}
kill_all() {