mirror of
https://github.com/darkclip/netlist.git
synced 2026-11-21 06:55:36 +08:00
update
This commit is contained in:
1 parent
df5a83a945
commit
47dd388057
2 files changed
+8
-3
No files matched your search
+4
-2
@@ -4,7 +4,7 @@ conf=$2;
|
||||
pids=$(pgrep -afl $0);
|
||||
if [ $(echo $pids|grep -o $0|wc -l) -gt 1 ]; then
|
||||
exit;
|
||||
fi
|
||||
fi;
|
||||
|
||||
get_rnd(){
|
||||
echo $(od -An -N2 -i /dev/random);
|
||||
@@ -43,4 +43,6 @@ while [ $loss -gt 40 ]; do
|
||||
loss=$(get_ping_loss $watch);
|
||||
done;
|
||||
endpoint=$(wg show $dev endpoints | awk '{print $2}');
|
||||
pfSsh.php playback chgwgpeer $conf $(echo $endpoint|awk -F: '{print $1}') $(echo $endpoint|awk -F: '{print $2}') || true;
|
||||
if [ $(pfSsh.php playback chgwgpeer $conf) != $endpoint ]; then
|
||||
pfSsh.php playback chgwgpeer $conf $(echo $endpoint|awk -F: '{print $1}') $(echo $endpoint|awk -F: '{print $2}') || true;
|
||||
fi;
|
||||
@@ -8,7 +8,10 @@ if (is_array($command_split)) {
|
||||
}
|
||||
|
||||
if (!isset($args[0]) || !isset($args[1]) || !isset($args[2])) {
|
||||
exit(-1);
|
||||
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";
|
||||
|
||||
Reference in new issue
Block a user