[V2+] r'string

Signed-off-by: Charles Le Maux <charles.le-maux@epitech.eu>
This commit is contained in:
Charles Le Maux 2024-06-26 00:23:11 +01:00
parent 61af7c6920
commit 34267cda12

View File

@ -89,8 +89,7 @@ def append_stream_config(port, subdomain, config_file_path='/etc/nginx/sites-ava
def remove_stream_config(port, subdomain, config_file_path='/etc/nginx/sites-available/servii.fr'): def remove_stream_config(port, subdomain, config_file_path='/etc/nginx/sites-available/servii.fr'):
pattern = (r'stream {{\s*server {{\s*listen 25565;\s*listen \[\(::\]\):' pattern = (r'stream {{\s*server {{\s*listen 25565;\s*listen \[\(::\]\):25565;\s*server_name {}.servii\.fr;\s*proxy_pass 127\.0\.0\.1:{};\s*}}}\n'
r'25565;\s*server_name {}.servii\.fr;\s*proxy_pass 127\.0\.0\.1:{};\s*}}}\n'
.format(re.escape(subdomain), port)) .format(re.escape(subdomain), port))
with open(config_file_path, 'r') as file: with open(config_file_path, 'r') as file:
content = file.read() content = file.read()