mirror of
https://github.com/bashclub/zamba-lxc-toolbox.git
synced 2025-10-28 06:32:27 +01:00
Merge pull request #138 from redhawk07/feature/zmb-member-multishares
Allow multiple shares for ZMB-MEMBER
This commit is contained in:
@@ -153,10 +153,10 @@ ZMB_ADMIN_PASS='Start!123'
|
|||||||
```
|
```
|
||||||
Please use 'single quotation marks' to avoid unexpected behaviour.
|
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-ad` domain administrator has to meet the password complexity policy, if password is too weak, domain provisioning will fail.
|
||||||
### ZMB_SHARE
|
### ZMB_SHARES
|
||||||
Defines the name of your Zamba share
|
Defines the names of your Zamba shares
|
||||||
```bash
|
```bash
|
||||||
ZMB_SHARE="share"
|
ZMB_SHARES="share1,share2"
|
||||||
```
|
```
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
# Name of the "domain admins" group (depends on your Active Directory language, valid on zmb-cups, lower case)
|
||||||
ZMB_DOMAIN_ADMINS="domain admins"
|
ZMB_DOMAIN_ADMINS="domain admins"
|
||||||
|
|
||||||
# Defines the name of your Zamba share
|
# Defines the names of your Zamba shares in a comma separated list
|
||||||
ZMB_SHARE="share"
|
ZMB_SHARES="share1,share2"
|
||||||
|
|
||||||
############### Mailpiler-Section ###############
|
############### Mailpiler-Section ###############
|
||||||
|
|
||||||
|
|||||||
@@ -75,8 +75,13 @@ cat > /etc/samba/smb.conf <<EOF
|
|||||||
shadow: snapprefix = ^zfs-auto-snap_\(frequent\)\{0,1\}\(hourly\)\{0,1\}\(daily\)\{0,1\}\(weekly\)\{0,1\}\(monthly\)\{0,1\}\(backup\)\{0,1\}\(manual\)\{0,1\}
|
shadow: snapprefix = ^zfs-auto-snap_\(frequent\)\{0,1\}\(hourly\)\{0,1\}\(daily\)\{0,1\}\(weekly\)\{0,1\}\(monthly\)\{0,1\}\(backup\)\{0,1\}\(manual\)\{0,1\}
|
||||||
shadow: delimiter = -20
|
shadow: delimiter = -20
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
IFS=',' read -r -a ZMB_SHARES_ARRAY <<< "$ZMB_SHARES"
|
||||||
|
for ZMB_SHARE in "${ZMB_SHARES_ARRAY[@]}"
|
||||||
|
do
|
||||||
|
cat >> /etc/samba/smb.conf << EOF
|
||||||
[$ZMB_SHARE]
|
[$ZMB_SHARE]
|
||||||
comment = Main Share
|
|
||||||
path = /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
path = /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
||||||
read only = No
|
read only = No
|
||||||
create mask = 0660
|
create mask = 0660
|
||||||
@@ -84,6 +89,7 @@ cat > /etc/samba/smb.conf <<EOF
|
|||||||
inherit acls = Yes
|
inherit acls = Yes
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
done
|
||||||
|
|
||||||
systemctl restart smbd
|
systemctl restart smbd
|
||||||
|
|
||||||
@@ -96,12 +102,15 @@ systemctl restart winbind nmbd
|
|||||||
wbinfo -u
|
wbinfo -u
|
||||||
wbinfo -g
|
wbinfo -g
|
||||||
|
|
||||||
mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
for SHARE in "${ZMB_SHARES_ARRAY[@]}"
|
||||||
|
do
|
||||||
|
mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
||||||
|
|
||||||
# originally 'domain users' was set, added variable for domain admins group, samba wiki recommends separate group e.g. 'unix admins'
|
# originally 'domain users' was set, added variable for domain admins group, samba wiki recommends separate group e.g. 'unix admins'
|
||||||
chown "${ZMB_ADMIN_USER@L}":"${ZMB_DOMAIN_ADMINS@L}" /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
chown "${ZMB_ADMIN_USER@L}":"${ZMB_DOMAIN_ADMINS@L}" /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
||||||
|
|
||||||
setfacl -Rm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
setfacl -Rm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
||||||
setfacl -Rdm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
setfacl -Rdm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
||||||
|
done
|
||||||
|
|
||||||
systemctl restart smbd nmbd winbind wsdd
|
systemctl restart smbd nmbd winbind wsdd
|
||||||
|
|||||||
@@ -65,14 +65,18 @@ EOF
|
|||||||
|
|
||||||
net conf import /etc/samba/import.template
|
net conf import /etc/samba/import.template
|
||||||
|
|
||||||
mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
IFS=',' read -r -a ZMB_SHARES_ARRAY <<< "$ZMB_SHARES"
|
||||||
chmod -R 770 /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
for ZMB_SHARE in "${ZMB_SHARES_ARRAY[@]}"
|
||||||
chown -R $USER:root /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
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 addshare $ZMB_SHARE /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
||||||
net conf setparm $ZMB_SHARE readonly no
|
net conf setparm $ZMB_SHARE readonly no
|
||||||
net conf setparm $ZMB_SHARE browseable yes
|
net conf setparm $ZMB_SHARE browseable yes
|
||||||
net conf setparm $ZMB_SHARE createmask 0660
|
net conf setparm $ZMB_SHARE createmask 0660
|
||||||
net conf setparm $ZMB_SHARE directorymask 0770
|
net conf setparm $ZMB_SHARE directorymask 0770
|
||||||
|
done
|
||||||
|
|
||||||
systemctl restart smbd nmbd wsdd
|
systemctl restart smbd nmbd wsdd
|
||||||
|
|||||||
Reference in New Issue
Block a user