diff --git a/imageroot/events/user-domain-changed/20configure_ldap b/imageroot/events/user-domain-changed/20configure_ldap new file mode 100755 index 0000000..6446776 --- /dev/null +++ b/imageroot/events/user-domain-changed/20configure_ldap @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# +# Copyright (C) 2023 Nethesis S.r.l. +# SPDX-License-Identifier: GPL-3.0-or-later +# + +import json +import sys +import agent +import os + +event = json.load(sys.stdin) + +if event.get('domain') != os.getenv('LDAP_DOMAIN'): + exit(0) + +agent.run_helper('systemctl', '--user', 'try-restart', 'sogo.service').check_returncode()