This commit is contained in:
darkclip committed 2023-09-02 05:33:10 +08:00
1 parent d9d1351ad5
commit a3a94e44bb
2 files changed
+19

No files matched your search

+1
View File
@@ -33,6 +33,7 @@ while [ $loss -gt 50 ]; do
cfip=$(cf_v4);
echo "changing $dev endpoint to $cfip";
wg set $dev peer "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=" endpoint "$cfip:4500";
pfSsh.php playback chgwgpeer 0 $cfip 4500 || true;
sleep 5;
loss=$(get_ping_loss $watch);
done;
+18
View File
@@ -0,0 +1,18 @@
global $config, $argv, $command_split;
if (is_array($command_split)) {
$args = array_slice($command_split, 2);
} else {
$args = array_slice($argv, 3);
}
if (!isset($args[0]) || !isset($args[1]) || !isset($args[2])) {
exit(-1);
}
echo $args[0] . " -> " . $args[1] . ":" . $args[2] . "\n";
$config['installedpackages']['wireguard']['peers']['item'][$args[0]]['endpoint'] = $args[1];
$config['installedpackages']['wireguard']['peers']['item'][$args[0]]['port'] = $args[2];
write_config();