Created
June 14, 2021 14:24
-
-
Save Alkanov/cd02d2034d4109e59c0e6f1924ee2d4b to your computer and use it in GitHub Desktop.
Generate AdGuard Home client list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devices = """192.168.0.100,monster_server,device_other | |
192.168.0.169,livingroom_shield,device_other | |
192.168.0.224,attic_nvr,device_securityalarm | |
192.168.0.207,office_huebridge,device_other | |
100.94.125.43,g-us-fl3_server,device_other | |
100.116.193.39,g-us-fl4_server,device_other | |
""" | |
template = """ | |
- name: {{%name}} | |
tags: | |
- {{%tag}} | |
ids: | |
- {{%ip}} | |
use_global_settings: true | |
filtering_enabled: false | |
parental_enabled: false | |
safesearch_enabled: false | |
safebrowsing_enabled: false | |
use_global_blocked_services: true | |
blocked_services: [] | |
upstreams: [] | |
""" | |
for device in devices.splitlines(): | |
print(template.replace("{{%name}}",device.split(",")[1]).replace("{{%tag}}",device.split(",")[2]).replace("{{%ip}}",device.split(",")[0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment