mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-06-28 09:16:55 +00:00
Update wgd.sh
This commit is contained in:
parent
908be168a9
commit
a042298a4a
@ -260,7 +260,7 @@ _determinePypiMirror(){
|
|||||||
# Extract the hostname from the URL
|
# Extract the hostname from the URL
|
||||||
hostname=$(echo "$url" | awk -F/ '{print $3}')
|
hostname=$(echo "$url" | awk -F/ '{print $3}')
|
||||||
# Ping the hostname once and extract the RTT
|
# Ping the hostname once and extract the RTT
|
||||||
rtt=$(ping -c 1 "$hostname" 2>/dev/null | grep 'time=' | awk -F'time=' '{print $2}' | awk '{print $1}')
|
rtt=$(ping -c 1 -W 1 "$hostname" 2>/dev/null | grep 'time=' | awk -F'time=' '{print $2}' | awk '{print $1}')
|
||||||
# Handle cases where the hostname is not reachable
|
# Handle cases where the hostname is not reachable
|
||||||
if [ -z "$rtt" ]; then
|
if [ -z "$rtt" ]; then
|
||||||
rtt="9999"
|
rtt="9999"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user