4
0
mirror of https://github.com/darkclip/netlist.git synced 2026-11-11 08:34:10 +08:00
This commit is contained in:
darkclip 2024-01-04 18:33:24 +08:00
parent 2f9853cab6
commit 0182b2066f

View File

@ -231,13 +231,16 @@ main(){
exit;
fi;
endpoint=$(wg show $INTERFACE endpoints | awk '{print $2}');
if [ $(uname -i) = 'pfSense' ]; then
if [ $(pfSsh.php playback wgpeer $CONFIG) != $endpoint ]; then
pfSsh.php playback wgpeer $CONFIG $(echo $endpoint|awk -F: '{print $1}') $(echo $endpoint|awk -F: '{print $2}') || true;
fi;
else
sed -i -r 's/Endpoint =.*/Endpoint = '$endpoint'/' $CONFIG;
fi;
case $(uname -i) in
pfSense)
if [ $(pfSsh.php playback wgpeer $CONFIG) != $endpoint ]; then
pfSsh.php playback wgpeer $CONFIG $(echo $endpoint|awk -F: '{print $1}') $(echo $endpoint|awk -F: '{print $2}') || true;
fi;
;;
*)
sed -i -r 's/Endpoint =.*/Endpoint = '$endpoint'/' $CONFIG;
;;
esac;
};