shadowsocks: When editing configuration, don't re-enable

If the app is disabled and configuration is edited, don't start the daemon.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
This commit is contained in:
Sunil Mohan Adapa 2020-03-17 11:45:12 -07:00 committed by Nektarios Katakis
parent 79a9948290
commit 6c73b18d7f
No known key found for this signature in database
GPG Key ID: 9CA475E691EBCF76

View File

@ -107,7 +107,11 @@ def subcommand_merge_config(_):
config = sys.stdin.read()
config = json.loads(config)
_merge_config(config)
action_utils.service_restart(shadowsocks.managed_services[0])
# Don't try_restart because initial configuration may not be valid so
# shadowsocks will not be running even when enabled.
if action_utils.service_is_enabled(shadowsocks.managed_services[0]):
action_utils.service_restart(shadowsocks.managed_services[0])
def main():