From 54ef036b78a770d306fbb01d7490037bdbcbfa47 Mon Sep 17 00:00:00 2001 From: Stefan Rutzmoser <7551295+redhawk07@users.noreply.github.com> Date: Wed, 8 Oct 2025 18:49:48 +0200 Subject: [PATCH 1/3] Allow multiple shares for ZMB-MEMBER --- conf/zamba.conf.example | 4 ++-- src/zmb-member/install-service.sh | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/conf/zamba.conf.example b/conf/zamba.conf.example index 7a3736a..0595879 100644 --- a/conf/zamba.conf.example +++ b/conf/zamba.conf.example @@ -114,8 +114,8 @@ ZMB_ADMIN_PASS='Start!123' # Name of the "domain admins" group (depends on your Active Directory language, valid on zmb-cups, lower case) ZMB_DOMAIN_ADMINS="domain admins" -# Defines the name of your Zamba share -ZMB_SHARE="share" +# Defines the names of your Zamba shares in a comma separated list +ZMB_SHARES="share1,share2" ############### Mailpiler-Section ############### diff --git a/src/zmb-member/install-service.sh b/src/zmb-member/install-service.sh index 0cc07d6..87e14fc 100644 --- a/src/zmb-member/install-service.sh +++ b/src/zmb-member/install-service.sh @@ -75,8 +75,13 @@ cat > /etc/samba/smb.conf <> /etc/samba/smb.conf << EOF [$ZMB_SHARE] - comment = Main Share path = /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE read only = No create mask = 0660 @@ -84,6 +89,7 @@ cat > /etc/samba/smb.conf < Date: Thu, 16 Oct 2025 21:28:41 +0200 Subject: [PATCH 2/3] Also for standalone --- src/zmb-standalone/install-service.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/zmb-standalone/install-service.sh b/src/zmb-standalone/install-service.sh index 190a8c0..2b8c358 100644 --- a/src/zmb-standalone/install-service.sh +++ b/src/zmb-standalone/install-service.sh @@ -65,14 +65,18 @@ EOF net conf import /etc/samba/import.template -mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE -chmod -R 770 /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE -chown -R $USER:root /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE +IFS=',' read -r -a ZMB_SHARES_ARRAY <<< "$ZMB_SHARES" +for ZMB_SHARE in "${ZMB_SHARES_ARRAY[@]}" +do + mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE + chmod -R 770 /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE + chown -R $USER:root /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE -net conf addshare $ZMB_SHARE /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE -net conf setparm $ZMB_SHARE readonly no -net conf setparm $ZMB_SHARE browseable yes -net conf setparm $ZMB_SHARE createmask 0660 -net conf setparm $ZMB_SHARE directorymask 0770 + net conf addshare $ZMB_SHARE /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE + net conf setparm $ZMB_SHARE readonly no + net conf setparm $ZMB_SHARE browseable yes + net conf setparm $ZMB_SHARE createmask 0660 + net conf setparm $ZMB_SHARE directorymask 0770 +done systemctl restart smbd nmbd wsdd From 9537faaaab70c17f2a06a44457b364b5a34078ee Mon Sep 17 00:00:00 2001 From: Stefan Rutzmoser <7551295+redhawk07@users.noreply.github.com> Date: Thu, 16 Oct 2025 21:29:24 +0200 Subject: [PATCH 3/3] Update README --- conf/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/README.md b/conf/README.md index 9bbbfb3..0d03fba 100644 --- a/conf/README.md +++ b/conf/README.md @@ -153,10 +153,10 @@ ZMB_ADMIN_PASS='Start!123' ``` Please use 'single quotation marks' to avoid unexpected behaviour. `zmb-ad` domain administrator has to meet the password complexity policy, if password is too weak, domain provisioning will fail. -### ZMB_SHARE -Defines the name of your Zamba share +### ZMB_SHARES +Defines the names of your Zamba shares ```bash -ZMB_SHARE="share" +ZMB_SHARES="share1,share2" ```