1
0
mirror of https://github.com/moshix/mvs.git synced 2026-03-01 09:21:03 +00:00

speeded up a bit more

This commit is contained in:
moshix
2023-04-16 15:19:14 -05:00
committed by GitHub
parent 68ec3dd059
commit dd7f1a9d93

View File

@@ -43,7 +43,6 @@ semaphore=0
}
# main loop here
set_color
if [[ "$1" == "-e" ]]; then
if [[ -z "$2" ]]; then
delay=1.4
@@ -53,9 +52,10 @@ if [[ "$1" == "-e" ]]; then
get_external &
fi
else
echo "${cyan}Use the -e 1.2 switch to get your external IP with timeout 1.2 secs${reset}"
echo "Use the -e 1.2 switch to get your external IP with timeout 1.2 secs" # we don't have color yet, to make things faster
fi
set_color
for nictype in lo wlan enp3s wlp2s en utun bridge docker tap tun ens eth vde-dnet-tap inettap
@@ -71,13 +71,19 @@ do
done
done
if [[ "$semaphore" == 1 ]]; then
echo -e "External IP: \t${red}no internet connection - or delay too short${reset}"
sleep 0.4 # give it another chance
fi
if [[ "$semaphore" == 1 ]]; then
echo -e "External IP: \t${red}no internet connection - or delay too short${reset}" # the other thread definetely not done yet
else
echo -e "${blue}External IP: \t${white}"`timeout $delay curl ifconfig.me 2>/dev/null || echo "${red}no internet connection - or delay too short${reset}"`
fi
if [[ "$1" == "-v" ]]; then
echo -e "${white}Version "$version"${reset}"
fi