More accurate backup regex.

Fixed an issue with picking up other backups when the names partially match.
pull/1151/head
freetushkan 2026-02-22 04:18:53 +03:00 committed by GitHub
parent bb18c55003
commit 9e998da84d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

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})_(.*)\\.(conf)$", f):
s = re.search(f"^({self.Name})_(.*)\\.(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,