From 744f129f46cc438a2a7eae338efa93d8e209a29c Mon Sep 17 00:00:00 2001 From: MarkusMcNugen Date: Fri, 14 Dec 2018 00:38:17 -0500 Subject: [PATCH] Display lan network and default gateway in log --- qbittorrent/iptables.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qbittorrent/iptables.sh b/qbittorrent/iptables.sh index cae9055..25b787c 100644 --- a/qbittorrent/iptables.sh +++ b/qbittorrent/iptables.sh @@ -18,13 +18,14 @@ echo "[info] WebUI port defined as ${WEBUI_PORT}" | ts '%Y-%m-%d %H:%M:%.S' DEBUG=false +# strip whitespace from start and end of LAN_NETWORK +export LAN_NETWORK=$(echo "${LAN_NETWORK}" | sed -e 's~^[ \t]*~~;s~[ \t]*$~~') +echo "[info] LAN Network defined as ${LAN_NETWORK}" | ts '%Y-%m-%d %H:%M:%.S' + # get default gateway of interfaces as looping through them DEFAULT_GATEWAY=$(ip -4 route list 0/0 | cut -d ' ' -f 3) echo "[info] Default gateway defined as ${DEFAULT_GATEWAY}" | ts '%Y-%m-%d %H:%M:%.S' -# strip whitespace from start and end of lan_network_item -export LAN_NETWORK=$(echo "${LAN_NETWORK}" | sed -e 's~^[ \t]*~~;s~[ \t]*$~~') - echo "[info] Adding ${LAN_NETWORK} as route via docker eth0" | ts '%Y-%m-%d %H:%M:%.S' ip route add "${LAN_NETWORK}" via "${DEFAULT_GATEWAY}" dev eth0