diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:20:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:20:02 +0000 |
commit | 0a354ad0b2c9eaaa204c31db478da109dc6d2a8b (patch) | |
tree | 2467caa8ad20a7fca31bef64224e41a4238db0c9 /debian/is-configured | |
parent | Adding upstream version 2:4.20.0+dfsg. (diff) | |
download | samba-3a2c5cebcb36894f34647fd035da7b843421d7c8.tar.xz samba-3a2c5cebcb36894f34647fd035da7b843421d7c8.zip |
Adding debian version 2:4.20.0+dfsg-1~exp1.debian/2%4.20.0+dfsg-1_exp1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/is-configured')
-rwxr-xr-x | debian/is-configured | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/is-configured b/debian/is-configured new file mode 100755 index 0000000..0ba6c22 --- /dev/null +++ b/debian/is-configured @@ -0,0 +1,32 @@ +#! /bin/sh +# Check if the given service (smb|nmb|winbind|samba) +# should be run according to the settings in smb.conf + +[ -f /etc/samba/smb.conf ] || exit 1 + +server_role=$(testparm -s --parameter-name="server role" 2>/dev/null) +[ "active directory domain controller" = "$server_role" ] \ + && addc=1 || addc=0 + +case "$1" in + ( smb | smbd ) + exit $addc + ;; + ( winbind | winbindd ) + exit $addc + ;; + ( nmb | nmbd ) + [ "$addc" = 1 ] && exit 1 + disable_netbios=$(testparm -s --parameter-name="disable netbios" 2>/dev/null) + [ Yes = "$disable_netbios" ] && exit 1 || exit 0 + ;; + ( samba | samba-ad-dc ) + # source4/samba/server.c checks for other parameters too, even if !AD-DC + # Should we support these? + exit $((!$addc)) + ;; + ( * ) + echo "Wrong usage: should be smb|nmb|winbind|samba" >&2 + exit 255 + ;; +esac |