Skip to content

Instantly share code, notes, and snippets.

@cuevasclemente
Created March 2, 2017 18:34
Show Gist options
  • Save cuevasclemente/f0230ed5e114bc66dbb8c54bb715c163 to your computer and use it in GitHub Desktop.
Save cuevasclemente/f0230ed5e114bc66dbb8c54bb715c163 to your computer and use it in GitHub Desktop.
Dirty script to get an ip address by hostname for an ssh server using avahi
#!/bin/bash
hostname=""
avahi-browse _ssh._tcp -r -t | awk "c&&c--;/$HOSTNAME/{c=2}" | grep 'address'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment