feat: Make Samba user configurable

This commit is contained in:
Kroese 2025-10-09 10:43:45 +02:00 committed by GitHub
parent aa575286f6
commit ac3f4e2971
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,8 @@ set -Eeuo pipefail
: "${SAMBA:="Y"}" # Enable Samba
: "${SAMBA_LEVEL:="1"}" # Logging level
: "${SAMBA_DEBUG:="N"}" # Disable debug
: "${SAMBA_USER:="root"}" # Samba user
: "${SAMBA_GROUP:="root"}" # Samba group
tmp="/tmp/smb"
rm -rf "$tmp"
@ -81,8 +83,8 @@ addShare() {
echo " writable = yes"
echo " guest ok = yes"
echo " guest only = yes"
echo " force user = root"
echo " force group = root"
echo " force user = $SAMBA_USER"
echo " force group = $SAMBA_GROUP"
} >> "/etc/samba/smb.conf"
return 0