mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 13:14:21 +01:00
Enable Samba on all supported interfaces (#2353)
* Restore interface configuration * run on all supported interfaces * add loopback to the interface list * fix ShellCheck errors
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 9.6.0
|
||||||
|
|
||||||
|
- Run on all supported interfaces
|
||||||
|
|
||||||
## 9.5.1
|
## 9.5.1
|
||||||
|
|
||||||
- Add `hassio_api` to add-on configuration
|
- Add `hassio_api` to add-on configuration
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
version: 9.5.1
|
version: 9.6.0
|
||||||
slug: samba
|
slug: samba
|
||||||
name: Samba share
|
name: Samba share
|
||||||
description: Expose Home Assistant folders with SMB/CIFS
|
description: Expose Home Assistant folders with SMB/CIFS
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
declare password
|
declare password
|
||||||
declare username
|
declare username
|
||||||
declare interface
|
declare -a interfaces
|
||||||
export HOSTNAME
|
export HOSTNAME
|
||||||
|
|
||||||
# Check Login data
|
# Check Login data
|
||||||
@@ -18,14 +18,17 @@ if bashio::var.is_empty "${HOSTNAME}"; then
|
|||||||
bashio::log.warning "Can't read hostname, using default."
|
bashio::log.warning "Can't read hostname, using default."
|
||||||
HOSTNAME="hassio"
|
HOSTNAME="hassio"
|
||||||
fi
|
fi
|
||||||
|
bashio::log.info "Hostname: ${HOSTNAME}"
|
||||||
|
|
||||||
# Get default interface
|
# Get supported interfaces
|
||||||
interface=$(bashio::network.name)
|
for interface in $(bashio::network.interfaces); do
|
||||||
|
interfaces+=("${interface}")
|
||||||
bashio::log.info "Using hostname=${HOSTNAME} interface=${interface}"
|
done
|
||||||
|
interfaces+=("lo")
|
||||||
|
bashio::log.info "Interfaces: $(printf '%s ' "${interfaces[@]}")"
|
||||||
|
|
||||||
# Generate Samba configuration.
|
# Generate Samba configuration.
|
||||||
jq ".interface = \"${interface}\"" /data/options.json \
|
jq ".interfaces = $(jq -c -n '$ARGS.positional' --args -- "${interfaces[@]}")" /data/options.json \
|
||||||
| tempio \
|
| tempio \
|
||||||
-template /usr/share/tempio/smb.gtpl \
|
-template /usr/share/tempio/smb.gtpl \
|
||||||
-out /etc/samba/smb.conf
|
-out /etc/samba/smb.conf
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
log level = 2
|
log level = 2
|
||||||
|
|
||||||
bind interfaces only = yes
|
bind interfaces only = yes
|
||||||
interfaces = {{ .interface }}
|
interfaces = {{ .interfaces | join " " }}
|
||||||
hosts allow = {{ .allow_hosts | join " " }}
|
hosts allow = {{ .allow_hosts | join " " }}
|
||||||
|
|
||||||
{{ if .compatibility_mode }}
|
{{ if .compatibility_mode }}
|
||||||
|
|||||||
Reference in New Issue
Block a user