Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сохранение полученных ip в формате команды для роутеров Mikrotik (ip/firewall/address-list add) #9

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use quotation marks for comment. Remove filters.
  • Loading branch information
Shaman2010 committed Aug 13, 2024
commit 72982c23e3fef6f2c39c7764c0bbc438e3973880
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def process_file_format(filename, filetype, gateway, selected_service, mk_list_n
if ips:
with open(filename, 'w', encoding='utf-8-sig') as file:
for ip in ips:
file.write(f'/ip/firewall/address-list add list={mk_list_name} comment={str(selected_service).replace("[", "").replace("]", "").replace("\'", "")} address={ip.strip()}/32\n')
file.write(f'/ip/firewall/address-list add list={mk_list_name} comment=\"{",".join(selected_service)}\" address={ip.strip()}/32\n')



Expand Down