From 5fea272f7aa8924ddf424cee87b5f9f55a0df138 Mon Sep 17 00:00:00 2001 From: darkclip Date: Fri, 5 Jan 2024 19:47:53 +0800 Subject: [PATCH] update --- wg-watch.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wg-watch.sh b/wg-watch.sh index cc672fe4..fc7832dd 100755 --- a/wg-watch.sh +++ b/wg-watch.sh @@ -238,7 +238,9 @@ main(){ fi; ;; *) - sed -i -r 's/Endpoint =.*/Endpoint = '$endpoint'/' $CONFIG; + if [ $(grep "Endpoint" $CONFIG|awk '{print $3}') != $endpoint ]; then + sed -i -r 's/Endpoint.*/Endpoint = '$endpoint'/' $CONFIG; + fi; ;; esac; };