diff options
Diffstat (limited to '')
-rwxr-xr-x | packaging/NetworkManager/30-winbind-systemd | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packaging/NetworkManager/30-winbind-systemd b/packaging/NetworkManager/30-winbind-systemd new file mode 100755 index 0000000..f740bb8 --- /dev/null +++ b/packaging/NetworkManager/30-winbind-systemd @@ -0,0 +1,20 @@ +#!/bin/sh +SYSTEMCTL=/bin/systemctl +winbind_is_active=$($SYSTEMCTL is-active winbind.service) +test "${winbind_is_active}" = "active" || exit 0 + +winbind_offline_logon=$(testparm -s --parameter-name "winbind offline logon" 2>/dev/null) +test "${winbind_offline_logon}" = "Yes" || exit 0 + +case "$2" in +up | vpn-up) + nmb_is_active=$($SYSTEMCTL is-active nmb.service) + if test "${nmb_is_active}" = "active"; then + $SYSTEMCTL try-restart nmb.service || : + fi + /usr/bin/smbcontrol winbind online || : + ;; +down) + /usr/bin/smbcontrol winbind offline + ;; +esac |