Simple program to check if ip adresses are active or not using ping command. NOTE One Thing: I'm not a C programmer, this code is simple and could be done better, but it works.
What it does is just ping a website (that you choose) and depending on which status code returns ping command, it's the status of the website/ip address.
Possible statuses are:
- 0 => Alive
- 1 or 256 => Unreachable
- 2 or 68 => Unknown host
- [Any other code] => Uknown
- Windows
- Linux
- Android (via Termux App)
- Stable Internet connection
Open PowerShell with Admin privileges and run this command:
Set-ExecutionPolicy RemoteSigned; Invoke-WebRequest https://raw.githubusercontent.com/1ray-1/check-ip/main/install-windows.ps1 -OutFile "$PWD\install-windows.ps1"; .\install-windows.ps1
And confirm with a "Y"
Open terminal and run this command:
wget https://raw.githubusercontent.com/1ray-1/check-ip/main/install-linux.sh; chmod +x install-linux.sh; clear; bash install-linux.sh
You'll have to enter sudo password on Linux
On both cases (linux and windows) the needed executable (for your system architecture) will be installed in a directory which is in PATH, so you can run it by just typing check-ip in terminal/cmd
You can just download the executable file for your OS here and execute it.
You can download this repo and build check-ip.c manually (using C compiler).
Usage: check-ip [OPTION] IP_ADRESSES_TO_CHECK
Options:
-s Save data to data.txt
-h, --help Get help text
Open CMD with admin privileges and type:
del C:\Windows\System32\check-ip.exe
Open terminal and type:
sudo rm /usr/bin/check-ip
if the above command doesn't work, type:
sudo rm /bin/check-ip
And enter sudo password
Run this command:
rm /data/data/com.termux/files/usr/bin/check-ip
Check Ip is licensed under MIT License.