#!/bin/bash

if [[ -n $1 ]]; then
    while IFS=: read ipaddr port service; do
	if [[ $1 == $service ]]; then
	    echo $ipaddr:$port
	fi
    done
fi