samba: Bind on enabled interfaces only (#4054)

This commit is contained in:
Stefan Agner
2025-06-24 21:13:41 +02:00
committed by GitHub
parent 1a1e7d4bd4
commit 7c4e5a91dc
4 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 12.5.2
- Avoid binding to disabled network interfaces
## 12.5.1
- Add configurations option to disable Apple devices interoperability. Disabling this setting might be required for file systems that do not support extended attributes such as exFAT.

View File

@ -1,5 +1,5 @@
---
version: 12.5.1
version: 12.5.2
slug: samba
name: Samba share
description: Expose Home Assistant folders with SMB/CIFS

View File

@ -26,7 +26,10 @@ bashio::log.info "Hostname: ${HOSTNAME}"
# Get supported interfaces
for interface in $(bashio::network.interfaces); do
interfaces+=("${interface}")
interface_enabled=$(bashio::network.enabled "${interface}")
if bashio::var.true "${interface_enabled}"; then
interfaces+=("${interface}")
fi
done
if [ ${#interfaces[@]} -eq 0 ]; then
bashio::exit.nok 'No supported interfaces found to bind on.'

View File

@ -15,7 +15,7 @@
log level = 1
bind interfaces only = yes
interfaces = 127.0.0.1 {{ .interfaces | join " " }}
interfaces = lo {{ .interfaces | join " " }}
hosts allow = 127.0.0.1 {{ .allow_hosts | join " " }}
{{ if .compatibility_mode }}