Docker: fix WG routes added to the correct interface (br0 or eth0)

This commit is contained in:
bergware
2023-12-28 11:51:39 +01:00
parent 4e80ead785
commit 84016c2e7c

View File

@@ -190,7 +190,7 @@ container_add_route(){
local PID=${CT[0]}
local NET=${CT[1]#*[}
local LAN=${NET%:*}
if [[ $PID -gt 0 && "${LAN//[^[0-9]/}" == "0" ]]; then
if [[ $PID -gt 0 && "${LAN//[^0-9]/}" == "0" ]]; then
local THISIP=$(sed -n '/^\[eth0\]$/,/^TYPE/p' $INI | grep -Pom1 '^IPADDR:0="\K[^"]+')
for CFG in /etc/wireguard/wg*.cfg ; do
local NETWORK=$(grep -Pom1 '^Network:0="\K[^"]+' $CFG)