This commit is contained in:
fatalerrors
2026-04-15 08:13:52 +02:00
parent e5bafe1721
commit b79103a0a6
2 changed files with 7 additions and 5 deletions

View File

@@ -148,7 +148,8 @@ export -f isipv6
# ------------------------------------------------------------------------------
# Encode a string so it can be used as a URL parameter
# Usage: urlencode <string>
urlencode() {
urlencode()
{
local LANG=C
local str="$*"
local length="${#str}"
@@ -177,7 +178,8 @@ export -f urlencode
# -c, --coord Display only the coordinates (latitude, longitude)
# -a, --as Display only the Autonomous System (AS) information
# -R, --raw Display raw JSON response
myextip() {
myextip()
{
local show_ip=false show_isp=false show_loc=false
local show_coord=false show_as=false show_raw=false
local all=true
@@ -236,7 +238,7 @@ myextip() {
# Fetch data. Allow overriding endpoint via env var MYEXTIP_URL
local MYEXTIP_URL
MYEXTIP_URL=${MYEXTIP_URL:-http://ip-api.com/json/}
MYEXTIP_URL=${MYEXTIP_URL:-https://ip-api.com/json/}
local response
if ! response=$(dwl "$MYEXTIP_URL"); then