ip_info.sh
· 519 B · Bash
Brut
#!/bin/bash
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
TZ="Asia/Taipei"
export PATH
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
# Check if curl is installed
if ! command -v curl &> /dev/null; then
echo "Error: curl is not installed. Please install curl and try again."
exit 1
fi
# Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "Error: jq is not installed. Please install jq and try again."
exit 1
fi
curl -s http://ip-api.com/json | jq
| 1 | #!/bin/bash |
| 2 | |
| 3 | SHELL=/bin/sh |
| 4 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
| 5 | TZ="Asia/Taipei" |
| 6 | export PATH |
| 7 | export LANG=en_US.UTF-8 |
| 8 | export LANGUAGE=en_US:en |
| 9 | |
| 10 | # Check if curl is installed |
| 11 | if ! command -v curl &> /dev/null; then |
| 12 | echo "Error: curl is not installed. Please install curl and try again." |
| 13 | exit 1 |
| 14 | fi |
| 15 | |
| 16 | # Check if jq is installed |
| 17 | if ! command -v jq &> /dev/null; then |
| 18 | echo "Error: jq is not installed. Please install jq and try again." |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
| 22 | curl -s http://ip-api.com/json | jq |