forked from angelnu/docker-mdns_repeater
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·20 lines (16 loc) · 834 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·20 lines (16 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# These are now set in environment variables that are passed in
#EXTERNAL_INTERFACE="wlan0"
#DOCKER_NETWORK_NAME="fermentrack"
#OPTIONS=""
# This searches the list of docker networks for the network name in order to get the ID, then (below) uses that ID
# to infer the docker interface name.
DOCKER_INTERFACE=$(docker network list | grep "${DOCKER_NETWORK_NAME}" | awk '{print $1}')
# Below is for future use in case I want to try to auto-detect the external interface
#NON_VIRTUAL_INTERFACES=($(ip addr | grep "state UP" -A2 | awk '/inet/{print $(NF)}' | grep -P '^(?:(?!veth).)*$' | tr '\n' ' '))
if [[ ${USE_MDNS_REPEATER} -eq 1 ]]; then
exec mdns-repeater -f ${OPTIONS} "${EXTERNAL_INTERFACE}" "br-${DOCKER_INTERFACE}"
else
# If the local user has disabled the app, then just sleep forever
sleep infinity
fi