feat: Set Samba socket

Added socket variable assignment and updated conditions for network handling.
This commit is contained in:
Kroese 2025-10-06 17:37:11 +02:00 committed by GitHub
parent c04851bbd4
commit 7a0be8950c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,17 +16,18 @@ rm -f /var/run/samba/smbd.pid
[[ "$NETWORK" == [Nn]* ]] && return 0 [[ "$NETWORK" == [Nn]* ]] && return 0
if [[ "$DHCP" == [Yy1]* ]]; then if [[ "$DHCP" == [Yy1]* ]]; then
socket="$IP"
hostname="$IP" hostname="$IP"
interfaces="$VM_NET_DEV" interfaces="$VM_NET_DEV"
else else
hostname="host.lan" hostname="host.lan"
case "${NETWORK,,}" in case "${NETWORK,,}" in
"user"* | "passt" | "slirp" ) "user"* | "passt" | "slirp" )
interfaces="lo" ;; interfaces="lo"
# if ! ip link set "$interfaces" multicast on >/dev/null; then socket="127.0.0.1" ;;
# warn "Failed to enable multicast on loopback interface!" *)
# fi ;; socket="$VM_NET_IP"
*) interfaces="$VM_NET_BRIDGE" ;; interfaces="$VM_NET_BRIDGE" ;;
esac esac
if [ -n "${SAMBA_INTERFACE:-}" ]; then if [ -n "${SAMBA_INTERFACE:-}" ]; then
interfaces+=",$SAMBA_INTERFACE" interfaces+=",$SAMBA_INTERFACE"
@ -100,6 +101,7 @@ addShare() {
echo " follow symlinks = yes" echo " follow symlinks = yes"
echo " wide links = yes" echo " wide links = yes"
echo " unix extensions = no" echo " unix extensions = no"
echo " socket address = $socket"
echo "" echo ""
echo " # disable printing services" echo " # disable printing services"
echo " load printers = no" echo " load printers = no"
@ -160,6 +162,12 @@ if [[ "$SAMBA_DEBUG" == [Yy1]* ]]; then
tail -fn +0 /var/log/samba/log.smbd & tail -fn +0 /var/log/samba/log.smbd &
fi fi
case "${NETWORK,,}" in
"user"* | "passt" | "slirp" )
return 0 ;;
esac
if [[ "${BOOT_MODE:-}" == "windows_legacy" ]]; then if [[ "${BOOT_MODE:-}" == "windows_legacy" ]]; then
# Enable NetBIOS on Windows 7 and lower # Enable NetBIOS on Windows 7 and lower