Well, it was in fact a friend's website in development, so maybe he has made some kind of special Apache settings. Sorry.
I will post URL here if I find other websites that returns strange values.
Anyhow, thanks for your help

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Well, it was in fact a friend's website in development, so maybe he has made some kind of special Apache settings. Sorry.
PING .... 56(84) bytes of data.
64 bytes from ......: icmp_seq=1 ttl=53 time=21.5 ms
---.........---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 21.522/21.522/21.522/0.000 ms
Code: Select all
on mouseUp
if CheckInternetConnection () is true
then
answer "ok"
else
answer "No connection"
end if
end mouseUp
function CheckInternetConnection
put "ping -n 1 google.com" into pCommandLines
set the hideConsoleWindows to true
put shell(pCommandLines) into tAnswer
if tAnswer contains "could not find" then put False into tAnswer else put True into tAnswer
return tAnswer
end CheckInternetConnection
I found this:
It can be tested with "durandexpertises.com"The responses to pings have been disabled by OVH on shared hosting.
Code: Select all
on mouseUp
get "durandexpertises.com"
put shell("ping " & it &" -c1") into fld "response"
end mouseUp
PING durandexpertises.com (136.0.165.69): 56 data bytes
--- durandexpertises.com ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
Ping satisfies that question fairly quickly, *if* you just want to know if your connected, and while pinging google certainly works, there are other options (such as a dns server, etc). In fact, IF I really want to know if i'm connected using ping, I'd probably pick 3 sites known to respond to ping for the 1 ping test, as the likelyhood that 3 sites would be down simultaneously is not very high.I would like to test if an internet connection is available from a stack.
Code: Select all
MTR.0.92,1585739064,OK,durandexpertises.com,13,???,100.00,10,10,0.00,0.00,0.00,0.00,0.00
Code: Select all
~$ telnet durandexpertises.com
Trying 136.0.165.69... <-- resolved the host name to an IP address, anyway...
telnet: Unable to connect to remote host: Connection timed out
Since my computer is set (as probably most are) to an ntp server, I'm relatively certain my clock and date are right. This brought me to my last test, the "is it down" site.Firefox wrote: Warning: Potential Security Risk Ahead
Firefox detected an issue and did not continue to www.durandexpertises.com. The website is either misconfigured or your computer clock is set to the wrong time.
It’s likely the website’s certificate is expired, which prevents Firefox from connecting securely. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.
What can you do about it?
Your computer clock is set to 4/1/2020. Make sure your computer is set to the correct date, time, and time zone in your system settings, and then refresh www.durandexpertises.com.
-->> If your clock is already set to the right time, the website is likely misconfigured, and there is nothing you can do to resolve the issue. You can notify the website’s administrator about the problem.
Considering the results I received outside of 'ping', again, I'm not really sure this site is a good example site even for the 2nd part of the thread. At best, you can only tell that the dns resolves, and that it can be reached in 13 hops, but you won't get much more than that from standard testing methods.Website Name:Durandexpertises
durandexpertises.comURL Checked:
no responseResponse Time:
unknownLast Down:
DOWN
Durandexpertises.com is DOWN
It is not just you. The server is not responding...
Despite the fact that this website seems to have trouble, as far as I know, all shared websites hosted at OVH don't respond to pings.
Code: Select all
function getPingDelay
// return 0 if not available connection
put "ping google.com -c1 | sed '$!d;s|.*/\([0-9.]*\)/.*|\1|'" into cmd
get shell(cmd)
if (it is not a number) then
return 0 // instead of an error string
else return it
end getPingDelay
Code: Select all
function net_isConnected // return boolean
put "google.com" into tUrl
if (the platform <> "MacOS") then
put "ping -n 1 " & tUrl into cmd
set the hideConsoleWindows to true
else put "ping " & tUrl & " -c1" into cmd
get shell(cmd) // localized windows string!!!
return ("TTL=" is in it) // unsafe test
end net_isConnected
Shell is not supported on mobile, it's a security risk.
Code: Select all
function isConnected // return boolean
put "google.com" into tUrl
if (the platform <> "MacOS") then
put "ping -n 1 " & tUrl & " > NUL && echo 1 || echo 0" into cmd
set the hideConsoleWindows to true
else put "ping -c 1 " & tUrl & " &> /dev/null && echo 1 || echo 0" into cmd
get shell(cmd)
return (it = 1)
end isConnected
Code: Select all
function isConnected // return boolean
put "google.com" into tUrl
if (the platform is not "Win32") then -- we're not on a Windows machine...
put "ping -c 1 " & tUrl & " &> /dev/null && echo 1 || echo 0" into cmd
set the hideConsoleWindows to true
else put "ping -n 1 " & tUrl & " > NUL && echo 1 || echo 0" into cmd
get shell(cmd)
return (it = 1)
end isConnected
Code: Select all
# Updated to change the return statement....
function isConnected // return boolean
put "google.com" into tUrl; put the platform into tPlat
if tPlat is not "Win32" then put "ping -c 1 " & tUrl & " &> /dev/null && echo 1 || echo 0" into cmd
if tPlat is "Win32" then put "ping -n 1 " & tUrl & " > NUL && echo 1 || echo 0" into cmd
set the hideConsoleWindows to true
return matchText(shell(cmd),"1 received")
end isConnected
Code: Select all
connect: Invalid argument
0
1
PING google.com (172.217.12.206) 56(84) bytes of data.
64 bytes from lga25s63-in-f14.1e100.net (172.217.12.206): icmp_seq=1 ttl=51 time=22.6 ms
--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.632/22.632/22.632/0.000 ms
1
PING google.com (172.217.12.206) 56(84) bytes of data.
64 bytes from lga25s63-in-f14.1e100.net (172.217.12.206): icmp_seq=1 ttl=51 time=21.6 ms
--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 21.646/21.646/21.646/0.000 ms