-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
24 lines (22 loc) · 825 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/with-contenv bashio
for host in $(bashio::config 'resolvers|keys'); do
server=$(bashio::config "resolvers[${host}].server")
# Look for & resolve Configured/Enable Home Assisitant Add-Ons
if echo "$server" | grep -q -E "^[a-z0-9]{5,8}-"; then
addon_ip=$(dig +short "$server")
addon_port=$(bashio::config "resolvers[${host}].port")
if [ -n "$addon_ip" ]; then
echo "$server ($addon_port) is an Addon -> $addon_ip"
export "${server//"-"}"="$addon_ip"
else
echo "$server failed to resolve, try restarting the add-on"
fi
fi
done
echo "Starting the Admin Web Server..."
python3 /app/web.py &
sleep 1
echo "Starting the HoneyPot (OpenCanary)..."
opencanaryd --start
echo "Starting the DNS Listener..."
python3 /app/listener.py