Make API service honor port from addon config

This commit is contained in:
Klaus-Uwe Mitterer 2021-11-04 15:53:20 +01:00 committed by GitHub
parent c68cd28954
commit 5f5a59b364
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,9 @@ declare public_key
declare transfer_rx
declare transfer_tx
PORT=$(bashio::config "ports" "80/tcp")
if [[ $PORT -eq 0 ]]; then exit; fi
while true; do
# Get information from wg
peers=()
@ -48,5 +51,5 @@ while true; do
fi
echo -e "HTTP/1.1 200 OK\r\nContent-type: application/json\r\n\r\n${json}" \
| nc -l -p 80 > /dev/null
| nc -l -p $PORT > /dev/null
done