Test webui table existancy before add

This commit is contained in:
Warrenberberd 2022-11-19 08:09:07 +01:00 committed by GitHub
parent b8e14d26c5
commit 350219ddd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,8 +61,10 @@ fi
# Default port for WEB_UI # Default port for WEB_UI
[ -z "${WEBUI_PORT}" ] && WEBUI_PORT="8080" [ -z "${WEBUI_PORT}" ] && WEBUI_PORT="8080"
echo "[info] Setup route table for webui" | ts '%Y-%m-%d %H:%M:%.S' if ! grep "webui" /etc/iproute2/rt_tables > /dev/null;then
echo "${WEBUI_PORT} webui" >> /etc/iproute2/rt_tables echo "[info] Setup route table for webui" | ts '%Y-%m-%d %H:%M:%.S'
echo "${WEBUI_PORT} webui" >> /etc/iproute2/rt_tables
fi
ip route flush table ${WEBUI_PORT} ip route flush table ${WEBUI_PORT}
ip route add ${LAN_NETWORK} dev eth0 table ${WEBUI_PORT} ip route add ${LAN_NETWORK} dev eth0 table ${WEBUI_PORT}