def _install_iptables(self, open_ports): for port in open_ports: ufw.allow(port) ufw.adjustStatus()
#!/usr/bin/python3 from iptables import ufw import avalon_framework as avalon import sys try: ports = [] for port in sys.argv[1:]: ports.append(int(port)) for port in ports: ufw.allow(port) except ValueError: avalon.error("Not a valid port number!")
def _install_iptables(self, open_ports): ufwctrl = ufw() for port in open_ports: ufw.allow(port)