From b252e5f21ac1521e797c31c9dfd4812997ca45bc Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 27 Aug 2023 17:13:58 +0100 Subject: [PATCH] syncthing/run: Set gui-address to first IP in container https://github.com/Poeschl/Hassio-Addons/issues/340 --- syncthing/root/etc/s6-overlay/s6-rc.d/syncthing/run | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/syncthing/root/etc/s6-overlay/s6-rc.d/syncthing/run b/syncthing/root/etc/s6-overlay/s6-rc.d/syncthing/run index 3d97ca54..9999ba64 100644 --- a/syncthing/root/etc/s6-overlay/s6-rc.d/syncthing/run +++ b/syncthing/root/etc/s6-overlay/s6-rc.d/syncthing/run @@ -7,5 +7,14 @@ export STNOUPGRADE=1 bashio::log.info 'Setup config' mkdir -p /data/config +ip=$(ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}' | head -n 1) + +if [ -z "$ip" ] +then + ip=0.0.0.0 +fi + +bashio::log.info "IP Address: $ip" + bashio::log.info 'Start syncthing' -syncthing --no-browser --no-restart --home=/data/config --gui-address=0.0.0.0:8384 +syncthing --no-browser --no-restart --home=/data/config --gui-address="$ip:8384"