mirror of
https://github.com/hassio-addons/addon-wireguard.git
synced 2025-05-05 03:11:22 +00:00
Make API service honor port from addon config
This commit is contained in:
parent
c68cd28954
commit
5f5a59b364
1 changed files with 4 additions and 1 deletions
|
@ -15,6 +15,9 @@ declare public_key
|
||||||
declare transfer_rx
|
declare transfer_rx
|
||||||
declare transfer_tx
|
declare transfer_tx
|
||||||
|
|
||||||
|
PORT=$(bashio::config "ports" "80/tcp")
|
||||||
|
if [[ $PORT -eq 0 ]]; then exit; fi
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
# Get information from wg
|
# Get information from wg
|
||||||
peers=()
|
peers=()
|
||||||
|
@ -48,5 +51,5 @@ while true; do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "HTTP/1.1 200 OK\r\nContent-type: application/json\r\n\r\n${json}" \
|
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
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue