summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-26 12:46:21 +0200
committerDavid Disseldorp <ddiss@samba.org>2012-10-30 13:17:02 +0100
commita3a1cd4797c99cb5fd0234c2dfe40e5dcafb05f8 (patch)
tree04f8728a55c955234a997c5030bb23ded4fb92af /packaging
parent4dfded000c8d8d62b1160fdf41357ccd8a77254b (diff)
downloadsamba-a3a1cd4797c99cb5fd0234c2dfe40e5dcafb05f8.tar.gz
packaging: Add NetworkManager dispatcher script for winbind.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Oct 30 13:17:02 CET 2012 on sn-devel-104
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/NetworkManager/30-winbind-systemd20
-rw-r--r--packaging/NetworkManager/README6
2 files changed, 26 insertions, 0 deletions
diff --git a/packaging/NetworkManager/30-winbind-systemd b/packaging/NetworkManager/30-winbind-systemd
new file mode 100755
index 00000000000..af0edf97471
--- /dev/null
+++ b/packaging/NetworkManager/30-winbind-systemd
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+winbind_is_active=$(/bin/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=$(/bin/systemctl is-active nmb.service)
+ if test "${nmb_is_active}" = "active"; then
+ /bin/systemctl try-restart nmb.service || :
+ fi
+ /usr/bin/smbcontrol winbind online || :
+ ;;
+ down)
+ /usr/bin/smbcontrol winbind offline
+ ;;
+esac
diff --git a/packaging/NetworkManager/README b/packaging/NetworkManager/README
new file mode 100644
index 00000000000..0db8be666f3
--- /dev/null
+++ b/packaging/NetworkManager/README
@@ -0,0 +1,6 @@
+This directory includes files for the dispatcher of NetworkManager. The files
+need to be copied to /etc/NetworkManager/dispatcher.d/ and will be automatically
+called if a network interface goes up or down.
+
+30-winbind-systemd: This will set winbind into offline mode if you have winbind
+ offline logon turned on.