NetVisor: fix grep in update (#9334)

This commit is contained in:
Chris
2025-11-21 09:33:24 -05:00
committed by GitHub
parent ff6cb3b87e
commit 43877a8b17

View File

@@ -51,7 +51,7 @@ function update_script() {
cp /opt/netvisor.env.bak /opt/netvisor/.env cp /opt/netvisor.env.bak /opt/netvisor/.env
LOCAL_IP="$(hostname -I | awk '{print $1}')" LOCAL_IP="$(hostname -I | awk '{print $1}')"
if ! grep -q "PUBLIC_URL"; then if ! grep -q "PUBLIC_URL" /opt/netvisor/.env; then
sed -i "\|_PATH=|a\NETVISOR_PUBLIC_URL=http://${LOCAL_IP}:60072" /opt/netvisor/.env sed -i "\|_PATH=|a\NETVISOR_PUBLIC_URL=http://${LOCAL_IP}:60072" /opt/netvisor/.env
fi fi
sed -i 's|_TARGET=.*$|_URL=http://127.0.0.1:60072|' /opt/netvisor/.env sed -i 's|_TARGET=.*$|_URL=http://127.0.0.1:60072|' /opt/netvisor/.env