Skip to content

Commit

Permalink
feat: Add user-domain-changed event handler for Nextcloud service man…
Browse files Browse the repository at this point in the history
…agement
  • Loading branch information
stephdl committed Nov 19, 2024
1 parent b340340 commit 26df31e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions imageroot/events/user-domain-changed /20configure_ldap
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python3

#
# Copyright (C) 2024 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('NEXTCLOUD_DOMAIN'):
exit(0)

if 'node' in event and str(event['node']) != os.getenv('NODE_ID'):
exit(0) # ignore event if the source is not in our node

agent.run_helper('systemctl', '--user', '-T', 'try-reload-or-restart', 'nextcloud.service').check_returncode()

0 comments on commit 26df31e

Please sign in to comment.