1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00

Fix omr-ip-intf for IPv4 mapped IPv6

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-10-12 08:27:13 +02:00
parent 7ee744a7c2
commit 0580c54e34

View file

@ -11,7 +11,7 @@ get_ip_from_server() {
get_ip() {
serverip=$1
getip="$(curl -s -k -4 -m ${timeout} --interface $intf https://$serverip:$serverport/clienthost)"
[ -n "$getip" ] && getip=$(echo $getip | jsonfilter -e '@.client_host')
[ -n "$getip" ] && getip=$(echo $getip | jsonfilter -e '@.client_host' | sed 's/::ffff://')
if expr "$getip" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
ip=$getip
break