mirror of
https://github.com/TG-Twilight/AWAvenue-Ads-Rule.git
synced 2025-11-04 14:49:47 +08:00
使用更简洁的 dnsmasq 规则格式
Some checks are pending
build Rule / execute_python_script (push) Waiting to run
Some checks are pending
build Rule / execute_python_script (push) Waiting to run
This commit is contained in:
parent
10c1ef3b72
commit
a7dca74f3b
@ -2,13 +2,11 @@
|
||||
def format_domain(List):
|
||||
domain = []
|
||||
for line in List:
|
||||
domain_lines = f"address=/{line.strip()}/0.0.0.0"
|
||||
domain.append(domain_lines)
|
||||
domain_lines = f"address=/{line.strip()}/::"
|
||||
domain_lines = f"address=/{line.strip()}/#"
|
||||
domain.append(domain_lines)
|
||||
return domain
|
||||
|
||||
|
||||
def build(rule):
|
||||
list = format_domain(rule.domain_list)
|
||||
return {'list': list, 'suffix': '.conf', 'comment': '#', 'total': len(list)}
|
||||
return {'list': list, 'suffix': '.conf', 'comment': '#', 'total': len(list)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user