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; };