Created
June 5, 2015 06:46
-
-
Save Hugne/0467dd78938b035cb545 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resolve () { | |
#lolers way of resolving an mdns service | |
res=`avahi-browse -vrptk $SERV_TYPE` | |
if [ $? -ne 0 ]; then | |
echo "avahi-browse fail" >&2 | |
exit 1 | |
fi | |
srv=`echo "$res" | awk '$1 ~ /=/ && match($0, /'$SERV_NAME'/) {gsub(";"," "); print $8":"$9;}'` | |
URL="http://$srv" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment