This commit is contained in:
darkclip committed 2023-12-31 06:49:43 +08:00
1 parent b924a7f65d
commit 6e897e86bd
1 file changed
+6 -4
+6 -4
View File
@@ -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;
};