mirror of
https://github.com/darkclip/netlist.git
synced 2026-11-11 00:34:07 +08:00
22 lines
743 B
Plaintext
22 lines
743 B
Plaintext
|
|
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])) {
|
|
if (isset($args[0])){
|
|
echo $config['installedpackages']['wireguard']['peers']['item'][$args[0]]['endpoint'] . ":" . $config['installedpackages']['wireguard']['peers']['item'][$args[0]]['port'];
|
|
}
|
|
exit(0);
|
|
}
|
|
|
|
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("wireguard: endpoint changed");
|