This commit is contained in:
darkclip committed 2023-08-03 03:20:55 +08:00
1 parent 6413f83e8d
commit 12c8536a5c
1 file changed
+1 -1
+1 -1
View File
@@ -6,7 +6,7 @@ get_rnd(){
};
get_ping_loss(){
loss_percent=$(ping -c 5 -q $1 | awk '/packet loss/{print $7}');
loss_percent=$(ping -c 5 -q $1 | awk '/packet loss/{for(i=6;i<=NF;i++)if($i ~ /packet/)print $((i-1))}');
loss=${loss_percent%?};
echo ${loss%.*};
return $?;