Skip to content
Snippets Groups Projects
Commit 5837bdad authored by Miguel Montes's avatar Miguel Montes
Browse files

Cambio en la expresión regular para procesar archivo /etc/hosts

parent 3ab6da08
Branches master
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ufw_delete = ufw_command + ["--force", "delete"] ...@@ -9,7 +9,7 @@ ufw_delete = ufw_command + ["--force", "delete"]
def read_hosts(): def read_hosts():
hosts = set() hosts = set()
pattern = re.compile(r"([0-9.:]+)\s+\w+-(sealer|gateway)") pattern = re.compile(r"([0-9.:]+)\s+\S+-(sealer|gateway)")
with open("/etc/hosts") as file: with open("/etc/hosts") as file:
for line in file: for line in file:
m = re.match(pattern,line) m = re.match(pattern,line)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment