#!/bin/bash echo echo "FailoverIPs on hosts" OUT=$(curl -u '#ws+7PVgXWxp:UypGThnJ5KJDXTCN' https://robot-ws.your-server.de/failover 2>/dev/null) #OUT=$(cat fo) #echo $OUT | jq -a -r '.[] | [ .failover.ip, .failover.active_server_ip ] | @csv' <<< $OUT | while read -r line do line=$(sed 's/"//g' <<< $line) IFS=',' read -r -a arr <<< "$line" FOIP=$(dig -x ${arr[0]} +short) HOST=$(dig -x ${arr[1]} +short) printf "%15s %20s => %15s %20s\n" ${arr[0]} ${FOIP::-1} ${arr[1]} ${HOST::-1} done echo echo