main() {
while read -r host port; do
while read -r ip; do
+ echo $ip | egrep '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*' &>/dev/null || continue
printf "remote %s %s\n" "$ip" "$port" >>$conf
ret=0
- done < <(dig +short $host ||:)
+ done < <(timeout -s 9 1 dig +short $host ||:)
done < <(sed -rn 's/^ *# *remote //p' $conf)
}