mirror of
https://github.com/hassio-addons/addon-wireguard.git
synced 2025-05-05 19:31:25 +00:00
Make API service honor port setting
This commit is contained in:
parent
c68cd28954
commit
5b98ad95fb
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::addon.port "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