firewall/roulette.py

15 lines
314 B
Python
Raw Normal View History

2020-01-18 13:23:41 +00:00
#! /usr/bin/python3
import requests
from firewall import NetfilterSet
ips = requests.get('http://roulette.rez/banned_ip').text.split('\n')
content = [(i,) for i in ips if i] or None
s = NetfilterSet(
target_content=content,
type_=('IPv4',),
name='ip_roulette',
table_name='firewall'
)
s.manage()