mirror of
https://github.com/darkclip/netlist.git
synced 2026-12-07 02:58:39 +08:00
update
This commit is contained in:
1 parent
3c1bd2c7bd
commit
249a07ec33
1 file changed
+6
-6
+6
-6
@@ -112,7 +112,7 @@ generate_ips(){
|
|||||||
speedtest(){
|
speedtest(){
|
||||||
exe_file='/var/tmp/warp';
|
exe_file='/var/tmp/warp';
|
||||||
result_file='/var/tmp/result.csv'
|
result_file='/var/tmp/result.csv'
|
||||||
if [ ! -f "$exe_file" ]; then
|
if [ ! -x "$exe_file" ]; then
|
||||||
curl -Sfo "$exe_file" "https://git.tink.ltd:8443/netlist.git/tree/warp-$1?raw=true&h=better-warp-ip";
|
curl -Sfo "$exe_file" "https://git.tink.ltd:8443/netlist.git/tree/warp-$1?raw=true&h=better-warp-ip";
|
||||||
fi;
|
fi;
|
||||||
ulimit -n 102400;
|
ulimit -n 102400;
|
||||||
@@ -184,7 +184,7 @@ main(){
|
|||||||
echo "Running on $arch"
|
echo "Running on $arch"
|
||||||
loss=$(get_ping_loss $WATCH_ADD);
|
loss=$(get_ping_loss $WATCH_ADD);
|
||||||
while [ $loss -ge $LOSS_THR ]; do
|
while [ $loss -ge $LOSS_THR ]; do
|
||||||
if [ ! "$ENDPOINTS" ]; then
|
if [ ! -r "$ENDPOINTS" ]; then
|
||||||
if [ $retry -lt $dl_retry_times ]; then
|
if [ $retry -lt $dl_retry_times ]; then
|
||||||
echo "Try to run speed test"
|
echo "Try to run speed test"
|
||||||
cadidates=$(get_ip_cadidates $FAMILY $DEFAULT_PORT $num_cadidates 1);
|
cadidates=$(get_ip_cadidates $FAMILY $DEFAULT_PORT $num_cadidates 1);
|
||||||
@@ -211,7 +211,7 @@ main(){
|
|||||||
if [ $DRY_RUN -eq 1 ]; then
|
if [ $DRY_RUN -eq 1 ]; then
|
||||||
continue;
|
continue;
|
||||||
fi;
|
fi;
|
||||||
if [ ! $INTERFACE ]; then
|
if [ -z $INTERFACE ]; then
|
||||||
continue;
|
continue;
|
||||||
fi;
|
fi;
|
||||||
wg set $INTERFACE peer $PUB_KEY endpoint $ip_port;
|
wg set $INTERFACE peer $PUB_KEY endpoint $ip_port;
|
||||||
@@ -224,10 +224,10 @@ main(){
|
|||||||
if [ $DRY_RUN -eq 1 ]; then
|
if [ $DRY_RUN -eq 1 ]; then
|
||||||
exit;
|
exit;
|
||||||
fi;
|
fi;
|
||||||
if [ ! $INTERFACE ]; then
|
if [ -z $INTERFACE ]; then
|
||||||
exit;
|
exit;
|
||||||
fi;
|
fi;
|
||||||
if [ ! $CONFIG ]; then
|
if [ -z $CONFIG ]; then
|
||||||
exit;
|
exit;
|
||||||
fi;
|
fi;
|
||||||
endpoint=$(wg show $INTERFACE endpoints | awk '{print $2}');
|
endpoint=$(wg show $INTERFACE endpoints | awk '{print $2}');
|
||||||
@@ -240,7 +240,7 @@ main(){
|
|||||||
fi;
|
fi;
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ $HOST ]; then
|
if [ -n $HOST ]; then
|
||||||
curl -kX POST "https://$HOST/api/wireguard/client/setClient/$UUID" \
|
curl -kX POST "https://$HOST/api/wireguard/client/setClient/$UUID" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Basic $BASIC" \
|
-H "Authorization: Basic $BASIC" \
|
||||||
|
|||||||
Reference in new issue
Block a user