-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
34 lines (30 loc) · 1.09 KB
/
run.sh
File metadata and controls
34 lines (30 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/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 &
if [ ! -f /config/opencanary.conf ]; then
echo "👉🏼 Writing default opencanary.conf"
cp /etc/opencanaryd/opencanary.conf /config/opencanary.conf
else
# Copy HomeAssistant Config to opencanary location
cp /config/opencanary.conf /etc/opencanaryd/opencanary.conf
fi
sleep 1
echo "Starting the HoneyPot (OpenCanary)..."
opencanaryd --start
sleep 1
echo "Starting the DNS Listener..."
python3 /app/listener.py