Hi!
commands.getstatusoutput("/etc/init.d/ufw restart") : Restart ufw by command -> https://wiki.ubuntu.com/UbuntuFirewall
When enabling the firewall and/or using '/etc/init.d/ufw start', the chains are necessarily flushed and connections may be dropped (eg ssh connections). You can add rules to the firewall before enabling it however, so if you are testing ufw on a remote machine, it is recommended you perform:
And this for read ufw status/configuration:
paths.py:path_gufw_status = "/etc/ufw/ufw.conf":
def check_gufw_status():
if file_search_string(path_gufw_status, c_gufw_enabled_infile) == c_found:
paths.py:path_ufw_config = "/etc/default/ufw":
def check_deny_all():
if file_search_string(path_ufw_config, c_deny_all_infile) == c_found:
def check_ipv6():
if file_search_string(path_ufw_config, c_ipv6_infile) == c_found:
--------------
and file_search_string only open for read ;)
def file_search_string(p_file, p_string):
try:
l_file = open(p_file, "r")
---------------
I forget remove this residual code:
paths.py:path_hide_ip_copy = "/etc/ufw/before.rules_copy"
paths.py:path_ufw_config_copy = "/etc/default/ufw_copy"
paths.py:path_hide_ip = "/etc/ufw/before.rules"
Hi! getstatusoutput ("/etc/ init.d/ ufw restart") : Restart ufw by command -> https:/ /wiki.ubuntu. com/UbuntuFirew all
commands.
When enabling the firewall and/or using '/etc/init.d/ufw start', the chains are necessarily flushed and connections may be dropped (eg ssh connections). You can add rules to the firewall before enabling it however, so if you are testing ufw on a remote machine, it is recommended you perform:
And this for read ufw status/ configuration: path_gufw_ status = "/etc/ufw/ ufw.conf" : status( ): string( path_gufw_ status, c_gufw_ enabled_ infile) == c_found:
paths.py:
def check_gufw_
if file_search_
paths.py: path_ufw_ config = "/etc/default/ufw": string( path_ufw_ config, c_deny_all_infile) == c_found: string( path_ufw_ config, c_ipv6_infile) == c_found:
def check_deny_all():
if file_search_
def check_ipv6():
if file_search_
-------------- string( p_file, p_string):
and file_search_string only open for read ;)
def file_search_
try:
l_file = open(p_file, "r")
---------------
I forget remove this residual code: path_hide_ ip_copy = "/etc/ufw/ before. rules_copy" path_ufw_ config_ copy = "/etc/default/ ufw_copy" path_hide_ ip = "/etc/ufw/ before. rules"
paths.py:
paths.py:
paths.py: