#!/bin/sh
#
# Univention Server
#  network script: restarts nscd and sssd when network state changes
#
# SPDX-FileCopyrightText: 2004-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only

. /etc/network/ucs-network-tools
ucs_ignore_interface

if ! [ -d /run/systemd/system ]; then
	[ -f /var/run/nscd/nscd.pid ] && [ -x /etc/init.d/nscd ] && invoke-rc.d nscd restart
	[ -f /var/run/sssd.pid ] && [ -x /etc/init.d/sssd ] && invoke-rc.d sssd restart
fi

[ -x /usr/sbin/sss_cache ] && sss_cache -U
# [ -x /usr/sbin/sss_cache ] && sss_cache -G
[ -x /usr/sbin/nscd ] &&  nscd -i group

exit 0
