Geolocate an IP address using the ip-api.com JSON API. The script displays various details such as city, region, country, ISP, and more. Additionally, it saves the fetched information to a JSON file.
To use the Geolocate script, follow these steps:
-
Clone the repository:
git clone https://github.com/haithamaouati/Geolocate.git
-
Navigate to the Geolocate directory:
cd Geolocate
-
Run the script with a specified IP address:
./geolocate.sh [OPTIONS] <IP address>
Replace
<IP address>
with the actual IP address you want to geolocate.
-h, --help
Displays the help message with usage instructions.
-i, --ip <IP>
Specify the IP address to geolocate. If not provided, the script will use your public IP.
-f, --file
Saves the geolocation information to a JSON file named after the IP address.
The script requires the following dependencies:
- figlet: Program for making large letters out of ordinary text
- curl: Command line tool for transferring data with URL syntax
- jq: Command-line JSON processor
Make sure to install these dependencies before running the script.
- Haitham Aouati
- GitHub: github.com/haithamaouati
This Geolocate Bash script is open-source and available under the MIT License.
Feel free to contribute or report issues on the GitHub repository.