1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/packaging/NetworkManager/30-winbind-systemd
Alexander Bokovoy 36da56ec51 Make systemctl reference indirect in packaging/NetworkManager/30-winbind-systemd
Some distributions have clever dependency generators when building packages
and generate dependencies for each executable called out in shell scripts.
The end result is that a package built out of samba would contain explicit dependency
to systemd even though it is usable without systemd.

Making systemctl reference indirect avoids explicit dependency.

Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Feb 22 18:18:20 CET 2013 on sn-devel-104
2013-02-22 18:18:20 +01:00

21 lines
555 B
Bash
Executable File

#!/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