mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-06 20:14:10 +08:00
Update adblock.sh
This commit is contained in:
1 parent
48272944c7
commit
f2fb147033
1 file changed
+2
-4
@@ -5,9 +5,6 @@ LOCK_FILE="/var/lock/ad_download.lock"
|
|||||||
TMP_DIR="/tmp/ad_download"
|
TMP_DIR="/tmp/ad_download"
|
||||||
RULES_PATH="/usr/share/passwall/rules"
|
RULES_PATH="/usr/share/passwall/rules"
|
||||||
|
|
||||||
# ========== 白名单:合并后需要排除的域名 ==========
|
|
||||||
WHITELIST="ip-api.com"
|
|
||||||
|
|
||||||
# ========== 加锁,防止重复运行 ==========
|
# ========== 加锁,防止重复运行 ==========
|
||||||
exec 200>"$LOCK_FILE"
|
exec 200>"$LOCK_FILE"
|
||||||
if ! flock -n 200; then
|
if ! flock -n 200; then
|
||||||
@@ -111,8 +108,9 @@ process_url() {
|
|||||||
[ ! -s "$parsed" ] && rm -f "$parsed"
|
[ ! -s "$parsed" ] && rm -f "$parsed"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ========== 读取所有 ad_url 并发下载 ==========
|
# ========== 读取 UCI 配置 ==========
|
||||||
AD_URLS=$(uci -q get passwall.@global[0].ad_url 2>/dev/null)
|
AD_URLS=$(uci -q get passwall.@global[0].ad_url 2>/dev/null)
|
||||||
|
WHITELIST="$(uci -q get passwall.@global[0].white_list 2>/dev/null) ip-api.com"
|
||||||
|
|
||||||
if [ -z "$AD_URLS" ]; then
|
if [ -z "$AD_URLS" ]; then
|
||||||
echo "[ERROR] 未找到任何 ad_url 配置"
|
echo "[ERROR] 未找到任何 ad_url 配置"
|
||||||
|
|||||||
Reference in new issue
Block a user