diff --git a/debian/changelog b/debian/changelog index 19f1c9a..05c46f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +omr-vps-admin (0.12+20240827) unstable; urgency=medium + + * Add support for "none" encryption with Shadowsocks-go + * Check if there is really a modification before modifying config file + + -- OpenMPTCProuter Tue, 27 Aug 2024 15:14:37 +0200 + omr-vps-admin (0.12+20240819) unstable; urgency=medium * Add LAN IPs info in status return diff --git a/omr-admin.py b/omr-admin.py index a05855b..2a6d900 100755 --- a/omr-admin.py +++ b/omr-admin.py @@ -25,6 +25,7 @@ import psutil import time import uuid +import copy from pprint import pprint from datetime import datetime, timedelta from tempfile import mkstemp @@ -300,11 +301,15 @@ def set_global_param(key, value): def modif_config_user(user, changes): with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json') as f: content = json.load(f) + content_initial = copy.deepcopy(content) content['users'][0][user].update(changes) - LOG.debug("backup_config() in modif_config_user") - backup_config() - with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json', 'w') as f: - json.dump(content, f, indent=4) + if content_initial != content: + LOG.debug("backup_config() in modif_config_user") + backup_config() + with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json', 'w') as f: + json.dump(content, f, indent=4) + else: + LOG.debug("No real changes in modif_config_user") def add_ss_user(port, key, userid=0, ip=''): with open('/etc/shadowsocks-libev/manager.json') as f: