This commit is contained in:
darkclip committed 2023-08-03 01:12:16 +08:00
1 parent cf47dd3937
commit 27f44c8e72
1 file changed
+3 -2
+3 -2
View File
@@ -6,8 +6,9 @@ get_rnd(){
};
get_ping_loss(){
loss_percent=$(ping -c 5 -q $1 | awk '/packet loss/{print $(NF-4)}');
echo ${loss_percent%?};
loss_percent=$(ping -c 5 -q $1 | awk '/packet loss/{print $((NF-4))}');
loss=${loss_percent%?};
echo ${loss%.*}
return $?;
};