Files
DFWebOS-Apps/agent-zero/exports.sh

17 lines
541 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export APP_AGENTZERO_PORT="3005"
local_ips=$(hostname --all-ip-addresses 2> /dev/null) || local_ips=""
export APP_AGENTZERO_LOCAL_IPS="${local_ips}"
# Создайте URLs с http:// и портом, разделенными запятыми.
ips_with_port=$(for ip in $local_ips; do
# Оберните адреса IPv6 в []
if [[ "$ip" == *:* ]]; then
echo -n "http://[$ip]:$APP_AGENTZERO_PORT,"
else
echo -n "http://$ip:$APP_AGENTZERO_PORT,"
fi
done | sed 's/,$//')
export APP_AGENTZERO_LOCAL_URLS="${ips_with_port}"