timmy revisó este gist 10 months ago. Ir a la revisión
Sin cambios
timmy revisó este gist 10 months ago. Ir a la revisión
Sin cambios
timmy revisó este gist 1 year ago. Ir a la revisión
1 file changed, 22 insertions
ip_info.sh(archivo creado)
| @@ -0,0 +1,22 @@ | |||
| 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 | |
Siguiente
Anterior