diff --git a/samba/CHANGELOG.md b/samba/CHANGELOG.md index 54edeee..241b128 100644 --- a/samba/CHANGELOG.md +++ b/samba/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 9.6.0 + +- Run on all supported interfaces + ## 9.5.1 - Add `hassio_api` to add-on configuration diff --git a/samba/config.yaml b/samba/config.yaml index 7113d78..4b0fc07 100644 --- a/samba/config.yaml +++ b/samba/config.yaml @@ -1,5 +1,5 @@ --- -version: 9.5.1 +version: 9.6.0 slug: samba name: Samba share description: Expose Home Assistant folders with SMB/CIFS diff --git a/samba/rootfs/etc/cont-init.d/samba.sh b/samba/rootfs/etc/cont-init.d/samba.sh index e8345ea..e2fd12e 100755 --- a/samba/rootfs/etc/cont-init.d/samba.sh +++ b/samba/rootfs/etc/cont-init.d/samba.sh @@ -4,7 +4,7 @@ # ============================================================================== declare password declare username -declare interface +declare -a interfaces export HOSTNAME # Check Login data @@ -18,14 +18,17 @@ if bashio::var.is_empty "${HOSTNAME}"; then bashio::log.warning "Can't read hostname, using default." HOSTNAME="hassio" fi +bashio::log.info "Hostname: ${HOSTNAME}" -# Get default interface -interface=$(bashio::network.name) - -bashio::log.info "Using hostname=${HOSTNAME} interface=${interface}" +# Get supported interfaces +for interface in $(bashio::network.interfaces); do + interfaces+=("${interface}") +done +interfaces+=("lo") +bashio::log.info "Interfaces: $(printf '%s ' "${interfaces[@]}")" # Generate Samba configuration. -jq ".interface = \"${interface}\"" /data/options.json \ +jq ".interfaces = $(jq -c -n '$ARGS.positional' --args -- "${interfaces[@]}")" /data/options.json \ | tempio \ -template /usr/share/tempio/smb.gtpl \ -out /etc/samba/smb.conf diff --git a/samba/rootfs/usr/share/tempio/smb.gtpl b/samba/rootfs/usr/share/tempio/smb.gtpl index 3a2ae1b..704e2aa 100644 --- a/samba/rootfs/usr/share/tempio/smb.gtpl +++ b/samba/rootfs/usr/share/tempio/smb.gtpl @@ -12,7 +12,7 @@ log level = 2 bind interfaces only = yes - interfaces = {{ .interface }} + interfaces = {{ .interfaces | join " " }} hosts allow = {{ .allow_hosts | join " " }} {{ if .compatibility_mode }}