From bdfca2dca2b34cd2a4b2baee4d6053bc68cf7b70 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Wed, 7 Apr 2021 09:59:43 +0300 Subject: [PATCH] Match an actual IPv4 address --- ssmtp_conf-sample/wanchecker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssmtp_conf-sample/wanchecker.sh b/ssmtp_conf-sample/wanchecker.sh index 385437d..316b387 100755 --- a/ssmtp_conf-sample/wanchecker.sh +++ b/ssmtp_conf-sample/wanchecker.sh @@ -204,7 +204,7 @@ function checkWANIP { fi if [[ $(cat "${WANIP_LOG}" | wc -l) -gt 1 ]] ; then - local WANIP_OLD=$(tail -1 "${WANIP_LOG}" | awk '{print $2}') + local WANIP_OLD=$(tail -1 "${WANIP_LOG}" | grep -oE '([0-9]{2,3}\.){3}([0-9]{2,3})') fi if [[ ${WANIP_OLD} == "" ]]; then