More accurate backup regex 2.

pull/1151/head
freetushkan 2026-02-23 21:36:41 +03:00 committed by GitHub
parent 9e998da84d
commit 930379a442
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -560,8 +560,8 @@ def API_getAllWireguardConfigurationBackup():
files.sort(key=lambda x: x[1], reverse=True)
for f, ct in files:
if RegexMatch(r"^(.*)_(.*)\.(conf)$", f):
s = re.search(r"^(.*)_(.*)\.(conf)$", f)
if RegexMatch(r"^(.+)_(\d+)\.(conf)$", f):
s = re.search(r"^(.+)_(\d+)\.(conf)$", f)
name = s.group(1)
if name not in existingConfiguration:
if name not in data['NonExistingConfigurations'].keys():

View File

@ -903,8 +903,8 @@ class WireguardConfiguration:
files.sort(key=lambda x: x[1], reverse=True)
for f, ct in files:
if RegexMatch(f"^({self.Name})_(\d*)\\.(conf)$", f):
s = re.search(f"^({self.Name})_(\d*)\\.(conf)$", f)
if RegexMatch(f"^({self.Name})_(\d+)\\.(conf)$", f):
s = re.search(f"^({self.Name})_(\d+)\\.(conf)$", f)
date = s.group(2)
d = {
"filename": f,