mirror of
https://github.com/bashclub/zamba-lxc-toolbox.git
synced 2025-12-10 16:51:42 +01:00
Compare commits
14 Commits
main
...
3e257d0534
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e257d0534 | ||
|
|
3bf682657a | ||
|
|
9537faaaab | ||
|
|
f37757a08a | ||
|
|
a31ebfb0e3 | ||
|
|
85caaac848 | ||
|
|
818cbfc732 | ||
|
|
664bc6ac5e | ||
|
|
54ef036b78 | ||
|
|
0460e3e5a1 | ||
|
|
5b263acbb2 | ||
|
|
3ee9538074 | ||
|
|
75559ca34b | ||
|
|
a3bd70732f |
@@ -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 ###############
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ ldbmodify -H /var/lib/samba/private/sam.ldb <<EOF
|
|||||||
dn: $DN
|
dn: $DN
|
||||||
changetype: modify
|
changetype: modify
|
||||||
replace: userWorkstations
|
replace: userWorkstations
|
||||||
userWorkstations: NONE
|
userWorkstations: "NOWORKSTATION"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -1,159 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
DEBUG_LOG="/tmp/mailcow_debug.log"
|
|
||||||
echo "" > "$DEBUG_LOG"
|
|
||||||
|
|
||||||
debug() {
|
|
||||||
echo "[DEBUG] $1"
|
|
||||||
echo "[DEBUG] $1" >> "$DEBUG_LOG"
|
|
||||||
}
|
|
||||||
|
|
||||||
debug "Starte Mailcow Check Script"
|
|
||||||
|
|
||||||
MAILCOW_PATH="/opt/mailcow-dockerized"
|
|
||||||
SPOOL_DIR="/var/lib/check_mk_agent/spool"
|
|
||||||
INTERVAL_SECONDS=87000
|
|
||||||
SPOOL_FILE="${SPOOL_DIR}/${INTERVAL_SECONDS}_mailcow_update"
|
|
||||||
CERT_DIR="${MAILCOW_PATH}/data/assets/ssl"
|
|
||||||
|
|
||||||
mkdir -p "$SPOOL_DIR"
|
|
||||||
TMP_FILE="$(mktemp)"
|
|
||||||
|
|
||||||
debug "Spool-Datei: $SPOOL_FILE"
|
|
||||||
debug "Temporäre Datei: $TMP_FILE"
|
|
||||||
|
|
||||||
# KORREKTER Header für Checkmk Local Checks
|
|
||||||
echo "<<<local>>>" > "$TMP_FILE"
|
|
||||||
|
|
||||||
debug "Wechsle ins Mailcow-Verzeichnis: $MAILCOW_PATH"
|
|
||||||
if ! cd "$MAILCOW_PATH"; then
|
|
||||||
echo "2 Mailcow_Update - ERROR: Verzeichnis $MAILCOW_PATH nicht gefunden" >> "$TMP_FILE"
|
|
||||||
echo "3 Mailcow_Version - UNKNOWN: Verzeichnis nicht gefunden" >> "$TMP_FILE"
|
|
||||||
mv "$TMP_FILE" "$SPOOL_FILE"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
NOW="$(date '+%Y-%m-%d %H:%M:%S')"
|
|
||||||
debug "Aktuelle Zeit: $NOW"
|
|
||||||
|
|
||||||
debug "Lese Mailcow Git-Version aus..."
|
|
||||||
GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
|
|
||||||
GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
|
|
||||||
|
|
||||||
debug "GIT_TAG=$GIT_TAG"
|
|
||||||
debug "GIT_COMMIT=$GIT_COMMIT"
|
|
||||||
|
|
||||||
if [[ -n "$GIT_TAG" ]]; then
|
|
||||||
echo "0 Mailcow_Version - OK: Version $GIT_TAG ($GIT_COMMIT)" >> "$TMP_FILE"
|
|
||||||
else
|
|
||||||
echo "0 Mailcow_Version - OK: Commit $GIT_COMMIT (kein Tag)" >> "$TMP_FILE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# UPDATE-CHECK
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
debug "Führe update.sh --check aus..."
|
|
||||||
UPDATE_CHECK=$(./update.sh --check 2>&1)
|
|
||||||
RET=$?
|
|
||||||
debug "Update Check Rückgabecode: $RET"
|
|
||||||
|
|
||||||
EXIT_CODE=0
|
|
||||||
|
|
||||||
if echo "$UPDATE_CHECK" | grep -q "No updates available"; then
|
|
||||||
debug "Kein Update verfügbar."
|
|
||||||
echo "0 Mailcow_Update - OK: Kein Update verfügbar ($NOW)" >> "$TMP_FILE"
|
|
||||||
else
|
|
||||||
debug "Update verfügbar! Starte Update..."
|
|
||||||
|
|
||||||
UPDATE_OUTPUT=$(./update.sh --force --skip-ping-check 2>&1)
|
|
||||||
EXIT_CODE=$?
|
|
||||||
|
|
||||||
if [ "$EXIT_CODE" -eq 0 ]; then
|
|
||||||
debug "Update erfolgreich."
|
|
||||||
echo "0 Mailcow_Update - OK: Update erfolgreich durchgeführt ($NOW)" >> "$TMP_FILE"
|
|
||||||
else
|
|
||||||
debug "Update fehlgeschlagen."
|
|
||||||
echo "2 Mailcow_Update - CRITICAL: Update fehlgeschlagen ($NOW)" >> "$TMP_FILE"
|
|
||||||
echo "$UPDATE_OUTPUT" >> "$TMP_FILE"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# SSL-ZERTIFIKATE PRÜFEN (mit SANs)
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
debug "Beginne SSL-Zertifikat-Scan unter: $CERT_DIR"
|
|
||||||
debug "Ignoriere Verzeichnis: $CERT_DIR/backups"
|
|
||||||
debug "Ignoriere Datei: $CERT_DIR/acme/account.pem"
|
|
||||||
debug "Ignoriere Dateien: key.pem, dhparams.pem"
|
|
||||||
|
|
||||||
if [ ! -d "$CERT_DIR" ]; then
|
|
||||||
echo "3 Mailcow_Certificates - UNKNOWN: SSL-Verzeichnis fehlt" >> "$TMP_FILE"
|
|
||||||
else
|
|
||||||
|
|
||||||
while IFS= read -r -d '' CERT_FILE; do
|
|
||||||
debug "Prüfe Zertifikat: $CERT_FILE"
|
|
||||||
|
|
||||||
REL_PATH="${CERT_FILE#${CERT_DIR}/}"
|
|
||||||
CERT_NAME="${REL_PATH//\//_}"
|
|
||||||
|
|
||||||
# Ablaufdatum lesen
|
|
||||||
END_DATE_RAW=$(openssl x509 -enddate -noout -in "$CERT_FILE" 2>/dev/null | cut -d= -f2)
|
|
||||||
|
|
||||||
# SANs extrahieren
|
|
||||||
SANS=$(openssl x509 -noout -text -in "$CERT_FILE" \
|
|
||||||
| grep -A1 "Subject Alternative Name" \
|
|
||||||
| tail -n1 \
|
|
||||||
| sed 's/DNS://g' \
|
|
||||||
| sed 's/, /,/g' \
|
|
||||||
| xargs)
|
|
||||||
|
|
||||||
debug "SANs: $SANS"
|
|
||||||
|
|
||||||
if [ -z "$END_DATE_RAW" ]; then
|
|
||||||
echo "3 Mailcow_Cert_${CERT_NAME} - UNKNOWN: Kein Ablaufdatum ($CERT_FILE)" >> "$TMP_FILE"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
END_EPOCH=$(date -d "$END_DATE_RAW" +%s 2>/dev/null)
|
|
||||||
NOW_EPOCH=$(date +%s)
|
|
||||||
SECONDS_LEFT=$((END_EPOCH - NOW_EPOCH))
|
|
||||||
DAYS_LEFT=$((SECONDS_LEFT / 86400))
|
|
||||||
|
|
||||||
debug "Noch $DAYS_LEFT Tage gültig"
|
|
||||||
|
|
||||||
if [ "$SECONDS_LEFT" -le 0 ]; then
|
|
||||||
STATE=2; STATE_TEXT="CRITICAL"; MSG="abgelaufen"
|
|
||||||
elif [ "$DAYS_LEFT" -le 14 ]; then
|
|
||||||
STATE=2; STATE_TEXT="CRITICAL"; MSG="läuft in <=14 Tagen ab"
|
|
||||||
elif [ "$DAYS_LEFT" -le 30 ]; then
|
|
||||||
STATE=1; STATE_TEXT="WARNING"; MSG="läuft bald ab"
|
|
||||||
else
|
|
||||||
STATE=0; STATE_TEXT="OK"; MSG="gültig"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "${STATE} Mailcow_Cert_${CERT_NAME} - ${STATE_TEXT}: ${MSG}, Ablauf: ${END_DATE_RAW}, SANs: ${SANS}" >> "$TMP_FILE"
|
|
||||||
|
|
||||||
done < <(
|
|
||||||
find "$CERT_DIR" \
|
|
||||||
-path "${CERT_DIR}/backups" -prune -o \
|
|
||||||
-type f \
|
|
||||||
! -path "$CERT_DIR/acme/account.pem" \
|
|
||||||
! -name "key.pem" \
|
|
||||||
! -name "dhparams.pem" \
|
|
||||||
\( -name "*.crt" -o -name "*.pem" -o -name "*.cert" \) \
|
|
||||||
-print0
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# SPEICHERN
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
debug "Speichere Spool-Datei: $SPOOL_FILE"
|
|
||||||
mv "$TMP_FILE" "$SPOOL_FILE"
|
|
||||||
|
|
||||||
debug "Script fertig. Exit-Code: $EXIT_CODE"
|
|
||||||
exit "$EXIT_CODE"
|
|
||||||
|
|
||||||
44
scripts/nextcloud-for-mailcow-dockerized.conf
Normal file
44
scripts/nextcloud-for-mailcow-dockerized.conf
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
|
||||||
|
server_name cloud.domain.tld;
|
||||||
|
|
||||||
|
ssl_certificate /etc/ssl/mail/cert.pem;
|
||||||
|
ssl_certificate_key /etc/ssl/mail/key.pem;
|
||||||
|
ssl_session_timeout 1d;
|
||||||
|
ssl_session_cache shared:SSL:50m;
|
||||||
|
ssl_stapling on;
|
||||||
|
ssl_stapling_verify on;
|
||||||
|
|
||||||
|
# HTTP → HTTPS
|
||||||
|
if ($scheme = http) {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass https://cloud.domain.tld;
|
||||||
|
|
||||||
|
# Hostname & Forwarded-Header sauber durchreichen
|
||||||
|
proxy_set_header Host 192.168.178.253; # explizit der Upstream-Name
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https; # TLS endet hier
|
||||||
|
proxy_set_header X-Forwarded-Host $host; # also cloud.domain.tld
|
||||||
|
proxy_set_header X-Forwarded-Port 443;
|
||||||
|
proxy_set_header Forwarded "for=$remote_addr;proto=https;host=$host";
|
||||||
|
proxy_set_header Referrer-Policy "no-referrer";
|
||||||
|
|
||||||
|
proxy_connect_timeout 600;
|
||||||
|
proxy_send_timeout 600;
|
||||||
|
proxy_read_timeout 600;
|
||||||
|
send_timeout 600;
|
||||||
|
client_max_body_size 10G;
|
||||||
|
}
|
||||||
|
|
||||||
|
# CalDAV/CardDAV Redirects
|
||||||
|
location /.well-known/carddav { return 301 https://$host/remote.php/dav; }
|
||||||
|
location /.well-known/caldav { return 301 https://$host/remote.php/dav; }
|
||||||
|
}
|
||||||
@@ -154,6 +154,6 @@ systemctl restart matrix-synapse
|
|||||||
|
|
||||||
rm /var/www/element-release-key.asc /var/www/element-$MATRIX_ELEMENT_VERSION.tar.gz /var/www/element-$MATRIX_ELEMENT_VERSION.tar.gz.asc
|
rm /var/www/element-release-key.asc /var/www/element-$MATRIX_ELEMENT_VERSION.tar.gz /var/www/element-$MATRIX_ELEMENT_VERSION.tar.gz.asc
|
||||||
|
|
||||||
register_new_matrix_user -a -u $MATRIX_ADMIN_USER -p \'$MATRIX_ADMIN_PASSWORD\' -c /etc/matrix-synapse/conf.d/registration.yaml http://127.0.0.1:8008
|
register_new_matrix_user -a -u $MATRIX_ADMIN_USER -p "$MATRIX_ADMIN_PASSWORD" -c /etc/matrix-synapse/conf.d/registration.yaml http://127.0.0.1:8008
|
||||||
|
|
||||||
echo -e "Your matrix installation is now complete. Please login into your element:\nLogin:\t\t$MATRIX_ADMIN_USER\nPassword:\t$MATRIX_ADMIN_PASSWORD\n\n"
|
echo -e "Your matrix installation is now complete. Please login into your element:\nLogin:\t\t$MATRIX_ADMIN_USER\nPassword:\t$MATRIX_ADMIN_PASSWORD\n\n"
|
||||||
@@ -39,15 +39,16 @@ ln -sf /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/nginx/ssl/fullchain.pem
|
|||||||
ln -sf /etc/ssl/private/ssl-cert-snakeoil.key /etc/nginx/ssl/privkey.pem
|
ln -sf /etc/ssl/private/ssl-cert-snakeoil.key /etc/nginx/ssl/privkey.pem
|
||||||
ln -sf /etc/nginx/dhparam.pem /etc/nginx/ssl/dhparam.pem
|
ln -sf /etc/nginx/dhparam.pem /etc/nginx/ssl/dhparam.pem
|
||||||
|
|
||||||
sed -e "s|server_name example.com;|server_name ${LXC_HOSTNAME}.${LXC_DOMAIN};|g" \
|
echo "Customizing nginx configuration..."
|
||||||
-e "s|ssl_certificate /etc/nginx/ssl/example.com-fullchain.pem;|ssl_certificate /etc/nginx/ssl/fullchain.pem;|g" \
|
sed -e "s|$(grep -m1 server_name /opt/zammad/contrib/nginx/zammad_ssl.conf)|server_name ${LXC_HOSTNAME}.${LXC_DOMAIN};|g" \
|
||||||
-e "s|ssl_certificate_key /etc/nginx/ssl/example.com-privkey.pem;|ssl_certificate_key /etc/nginx/ssl/privkey.pem;|g" \
|
-e "s|$(grep -m1 ssl_certificate /opt/zammad/contrib/nginx/zammad_ssl.conf)|ssl_certificate /etc/nginx/ssl/fullchain.pem;|g" \
|
||||||
-e "s|ssl_protocols TLSv1.2;|ssl_protocols TLSv1.2 TLSv1.3;|g" \
|
-e "s|$(grep -m1 ssl_certificate_key /opt/zammad/contrib/nginx/zammad_ssl.conf)|ssl_certificate_key /etc/nginx/ssl/privkey.pem;|g" \
|
||||||
-e "s|ssl_trusted_certificate /etc/nginx/ssl/lets-encrypt-x3-cross-signed.pem;|# ssl_trusted_certificate /etc/nginx/ssl/lets-encrypt-x3-cross-signed.pem;|g" \
|
-e "s|$(grep -m1 ssl_protocols /opt/zammad/contrib/nginx/zammad_ssl.conf)|ssl_protocols TLSv1.2 TLSv1.3;|g" \
|
||||||
|
-e "s|$(grep -m1 ssl_dhparam /opt/zammad/contrib/nginx/zammad_ssl.conf)|ssl_dhparam /etc/nginx/ssl/dhparam.pem;|g" \
|
||||||
|
-e "s|$(grep -m1 ssl_trusted_certificate /opt/zammad/contrib/nginx/zammad_ssl.conf)|# ssl_trusted_certificate /etc/nginx/ssl/lets-encrypt-x3-cross-signed.pem;|g" \
|
||||||
/opt/zammad/contrib/nginx/zammad_ssl.conf > /etc/nginx/sites-available/zammad_ssl.conf
|
/opt/zammad/contrib/nginx/zammad_ssl.conf > /etc/nginx/sites-available/zammad_ssl.conf
|
||||||
|
|
||||||
ln -sf /etc/nginx/sites-available/zammad_ssl.conf /etc/nginx/sites-enabled/
|
ln -sf /etc/nginx/sites-available/zammad_ssl.conf /etc/nginx/sites-enabled/
|
||||||
|
|
||||||
|
|
||||||
# configure elasticsearch
|
# configure elasticsearch
|
||||||
/usr/share/elasticsearch/bin/elasticsearch-plugin install -b ingest-attachment
|
/usr/share/elasticsearch/bin/elasticsearch-plugin install -b ingest-attachment
|
||||||
|
|||||||
@@ -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,17 @@ systemctl restart winbind nmbd
|
|||||||
wbinfo -u
|
wbinfo -u
|
||||||
wbinfo -g
|
wbinfo -g
|
||||||
|
|
||||||
mkdir -p /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
unset ZMB_SHARE
|
||||||
|
|
||||||
# originally 'domain users' was set, added variable for domain admins group, samba wiki recommends separate group e.g. 'unix admins'
|
for ZMB_SHARE in "${ZMB_SHARES_ARRAY[@]}"
|
||||||
chown "${ZMB_ADMIN_USER@L}":"${ZMB_DOMAIN_ADMINS@L}" /$LXC_SHAREFS_MOUNTPOINT/$ZMB_SHARE
|
do
|
||||||
|
mkdir -p /$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
|
# originally 'domain users' was set, added variable for domain admins group, samba wiki recommends separate group e.g. 'unix admins'
|
||||||
setfacl -Rdm u:${ZMB_ADMIN_USER@L}:rwx,g:"${ZMB_DOMAIN_ADMINS@L}":rwx,o::- /$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 -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