From 6e897e86bd0e53f60eb3e5e45a74536ebea993df Mon Sep 17 00:00:00 2001 From: darkclip Date: Sun, 31 Dec 2023 06:49:43 +0800 Subject: [PATCH] update --- cf-watch.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cf-watch.sh b/cf-watch.sh index dd90a9bb..d136a89c 100755 --- a/cf-watch.sh +++ b/cf-watch.sh @@ -3,7 +3,7 @@ family=$1; interface=$2; -conf_num=$3; +config=$3; debug=false; @@ -187,12 +187,14 @@ main(){ if [ ! $interface ]; then exit 0; fi; - if [ ! $conf_num ]; then + if [ ! $config ]; then exit 0; fi; endpoint=$(wg show $interface endpoints | awk '{print $2}'); - if [ $(pfSsh.php playback chgwgpeer $conf_num) != $endpoint ]; then - pfSsh.php playback chgwgpeer $conf_num $(echo $endpoint|awk -F: '{print $1}') $(echo $endpoint|awk -F: '{print $2}') || true; + if [ $(uname -i) == 'pfSense' ]; then + if [ $(pfSsh.php playback chgwgpeer $config) != $endpoint ]; then + pfSsh.php playback chgwgpeer $config $(echo $endpoint|awk -F: '{print $1}') $(echo $endpoint|awk -F: '{print $2}') || true; + fi; fi; };