diff --git a/run/network.sh b/run/network.sh index 4832718..aa11c80 100644 --- a/run/network.sh +++ b/run/network.sh @@ -227,8 +227,25 @@ if [[ "${DHCP}" == [Yy1]* ]]; then configureDHCP pkill -f server.sh || true - /run/server.sh 80 ipinfo > /dev/null & - /run/server.sh 5000 ipinfo > /dev/null & + + SH_SCRIPT="/run/ipinfo.sh" + + { echo "#!/bin/bash" + echo "INFO=\$(curl -s -m 5 -S http://127.0.0.1:2210/read?command=10 2>/dev/null)" + echo "rest=\${INFO#*http_port}; rest=\${rest#*:}; rest=\${rest%%,*}; PORT=\${rest%%\\\"*}" + echo "rest=\${INFO#*eth0}; rest=\${rest#*ip}; rest=\${rest#*:}; rest=\${rest#*\\\"}; IP=\${rest%%\\\"*}" + echo "BODY=\"The location of DSM is http://\${IP}:\${PORT}\"" + echo "HTML=\"