Hack IFS in 'detect-external-ip' script of Docker image to support both Debian and Alpine

This commit is contained in:
tyranron 2021-05-17 23:38:38 +03:00
parent 484c88ea2a
commit f2f8796e8c
No known key found for this signature in database
GPG Key ID: 762E144FB230A4F0

View File

@ -100,7 +100,8 @@ else
}
fi
IFS=$'\n'; for COMMAND in $COMMANDS; do
IFS="$(printf '\nx')" && IFS="${IFS%x}"
for COMMAND in $COMMANDS; do
if IP="$(eval "$COMMAND")" && is_valid_ip "$IP"; then
printf '%s' "$IP"
exit 0