mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 08:45:13 +08:00
🎉 Sync 2026-04-03 20:25:30
This commit is contained in:
1 parent
6b6cae9986
commit
4dbadea522
49 files changed
+754
-639
No files matched your search
@@ -1042,10 +1042,10 @@ firewall_lan_ac_traffic()
|
||||
rule_target_v4="! -d ${fakeip_range} ${src_ip} ${sport_ipt} ${interface_rule} ${dscp_ipt} -j ${target} -m comment --comment ${comment}"
|
||||
output_rule_target_v4="! -d ${fakeip_range} ${src_ip} ${sport_ipt} ${user_rule} ${interface_rule} ${dscp_ipt} -j ${target} -m comment --comment ${comment}"
|
||||
|
||||
rule_target_v6_="! -d ${fakeip_range6} ${src_ip} ${sport_ipt} ${interface_rule} ${dscp_ipt} -j ${target_} -m comment --comment ${comment}"
|
||||
output_rule_target_v6_="! -d ${fakeip_range6} ${src_ip} ${sport_ipt} ${user_rule} ${interface_rule} ${dscp_ipt} -j ${target_} -m comment --comment ${comment}"
|
||||
rule_target_v6="! -d ${fakeip_range6} ${src_ip} ${sport_ipt} ${interface_rule} ${dscp_ipt} -j ${target} -m comment --comment ${comment}"
|
||||
output_rule_target_v6="! -d ${fakeip_range6} ${src_ip} ${sport_ipt} ${user_rule} ${interface_rule} ${dscp_ipt} -j ${target} -m comment --comment ${comment}"
|
||||
rule_target_v6_="! -d ${fakeip_range6} ${src_ip_v6} ${sport_ipt} ${interface_rule} ${dscp_ipt} -j ${target_} -m comment --comment ${comment}"
|
||||
output_rule_target_v6_="! -d ${fakeip_range6} ${src_ip_v6} ${sport_ipt} ${user_rule} ${interface_rule} ${dscp_ipt} -j ${target_} -m comment --comment ${comment}"
|
||||
rule_target_v6="! -d ${fakeip_range6} ${src_ip_v6} ${sport_ipt} ${interface_rule} ${dscp_ipt} -j ${target} -m comment --comment ${comment}"
|
||||
output_rule_target_v6="! -d ${fakeip_range6} ${src_ip_v6} ${sport_ipt} ${user_rule} ${interface_rule} ${dscp_ipt} -j ${target} -m comment --comment ${comment}"
|
||||
|
||||
if [ "${family}" == "both" ] || [ "${family}" == "ipv4" ]; then
|
||||
if [ -z "${en_mode_tun}" ] || [ "${en_mode_tun}" -eq 2 ]; then
|
||||
@@ -3868,7 +3868,6 @@ stop_service()
|
||||
rm -rf /tmp/clash_last_version \
|
||||
/tmp/openclash_last_version \
|
||||
/tmp/openclash.change \
|
||||
/tmp/openclash_debug.log \
|
||||
/tmp/openclash_announcement \
|
||||
${DNSMASQ_CONF_DIR}/dnsmasq_openclash_chnroute_pass.conf \
|
||||
${DNSMASQ_CONF_DIR}/dnsmasq_openclash_chnroute6_pass.conf \
|
||||
|
||||
@@ -84,19 +84,22 @@ module YAML
|
||||
indent = $1
|
||||
value = $2.strip
|
||||
if value.empty?
|
||||
in_short_id = true
|
||||
(short_id_index + 1...lines.size).each do |i|
|
||||
line = lines[i]
|
||||
next if line.strip.empty?
|
||||
if line[/^\s*/].length <= short_id_indent_len
|
||||
break
|
||||
end
|
||||
if line =~ LIST_ITEM_REGEX
|
||||
if in_short_id
|
||||
indent = $1
|
||||
value = $2.strip
|
||||
if value !~ QUOTED_VALUE_REGEX
|
||||
lines[i] = "#{indent}- \"#{value}\"\n"
|
||||
end
|
||||
indent = $1
|
||||
value = $2.strip
|
||||
if value =~ KEY_REGEX
|
||||
break
|
||||
end
|
||||
if value !~ QUOTED_VALUE_REGEX
|
||||
lines[i] = "#{indent}- \"#{value}\"\n"
|
||||
end
|
||||
elsif line =~ KEY_REGEX
|
||||
in_short_id = false
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
@@ -72,13 +72,13 @@ config_download()
|
||||
LOG_TIP "Config File【$name】Downloading User-Agent【$sub_ua】..."
|
||||
if [ -n "$subscribe_url_param" ] && [ -n "$c_address" ]; then
|
||||
LOG_INFO "Config File【$name】Downloading URL【$c_address$subscribe_url_param】..."
|
||||
DOWNLOAD_URL="${c_address}${subscribe_url_param}"
|
||||
DOWNLOAD_PARAM="$sub_ua"
|
||||
local DOWNLOAD_URL="${c_address}${subscribe_url_param}"
|
||||
local DOWNLOAD_PARAM="$sub_ua"
|
||||
fi
|
||||
if [ -z "$DOWNLOAD_URL" ]; then
|
||||
LOG_INFO "Config File【$name】Downloading URL【$subscribe_url】..."
|
||||
DOWNLOAD_URL="${subscribe_url}"
|
||||
DOWNLOAD_PARAM="$sub_ua"
|
||||
local DOWNLOAD_URL="${subscribe_url}"
|
||||
local DOWNLOAD_PARAM="$sub_ua"
|
||||
fi
|
||||
DOWNLOAD_FILE_CURL "$DOWNLOAD_URL" "$CFG_FILE" "$CONFIG_FILE" "$DOWNLOAD_PARAM"
|
||||
DOWNLOAD_RESULT=$?
|
||||
@@ -395,9 +395,9 @@ sub_info_get()
|
||||
if [ "$sub_convert" -eq 0 ]; then
|
||||
subscribe_url=$address
|
||||
elif [ "$sub_convert" -eq 1 ] && [ -n "$template" ]; then
|
||||
while read line
|
||||
do
|
||||
subscribe_url=$([ -n "$subscribe_url" ] && echo "$subscribe_url|")$(urlencode "$line")
|
||||
while IFS= read -r line; do
|
||||
line=$(echo "$line" | tr -d '\r')
|
||||
subscribe_url=$([ -n "$subscribe_url" ] && echo "$subscribe_url|")$(urlencode "$line")
|
||||
done < <(echo "$address")
|
||||
if [ "$template" != "0" ]; then
|
||||
template_path=$(grep "^$template," /usr/share/openclash/res/sub_ini.list |awk -F ',' '{print $3}' 2>/dev/null)
|
||||
|
||||
@@ -228,7 +228,7 @@ LOG_ERROR()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
echo -e "${1}" > $START_LOG
|
||||
echo -e "${LOGTIME} [error] ${1}" >> $LOG_FILE
|
||||
echo -e "${LOGTIME} [Error] ${1}" >> $LOG_FILE
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ LOG_TIP()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
echo -e "${1}" > $START_LOG
|
||||
echo -e "${LOGTIME} [tip] ${1}" >> $LOG_FILE
|
||||
echo -e "${LOGTIME} [Tip] ${1}" >> $LOG_FILE
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +182,8 @@ done >/dev/null 2>&1
|
||||
|
||||
#check the clash service status
|
||||
if ! ubus call service list '{"name":"openclash"}' 2>/dev/null | jsonfilter -e '@.openclash.instances.*.running' | grep -q 'true'; then
|
||||
uci -q set openclash.config.enable=0
|
||||
uci -q commit openclash
|
||||
/etc/init.d/openclash stop >/dev/null 2>&1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -2,11 +2,5 @@
|
||||
|
||||
uci_get_config() {
|
||||
local key="$1"
|
||||
local val
|
||||
val=$(uci -q get openclash.@overwrite[0]."$key" 2>/dev/null)
|
||||
if [ -n "$val" ]; then
|
||||
echo "$val"
|
||||
else
|
||||
uci -q get openclash.config."$key"
|
||||
fi
|
||||
uci -q get openclash.@overwrite[0]."$key" || uci -q get openclash.config."$key"
|
||||
}
|
||||
Reference in new issue
Block a user