<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:10px"><div style="margin-top: 0px; margin-bottom: 1em; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.8048000335693px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" class="" id="yui_3_16_0_1_1416592596188_4341">Hello,</div><div style="margin-top: 0px; margin-bottom: 1em; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.8048000335693px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" class="" id="yui_3_16_0_1_1416592596188_4341"><span style="line-height: 17.8048000335693px;" id="yui_3_16_0_1_1416592596188_4358">I am looking for a way for a Linux machine to tell when I return home. My idea is that my iPhone will always do an mDNS announcement when it joins my home wifi. So I'm looking for a way to watch for mDNS announcements and perform and action if the right one is seen. Obviously the avahi-daemon is watching these all the time and updating its cache, so I was thinking that there might be a good place to start. </span></div><div style="margin-top: 0px; margin-bottom: 1em; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.8048000335693px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" class="" id="yui_3_16_0_1_1416592596188_4341"><span style="line-height: 17.8048000335693px;" id="yui_3_16_0_1_1416592596188_4374">However the only command line way I can see to get to the avahi-daemon cache is to send a SIGUSR1 to get it to dump to /var/log/syslog. Then I can look at the timestamp to determine the last time it registered and compare with now. That seems quite ugly though, and I don't like the idea of continually dumping to syslog.</span><br></div><div style="margin-top: 0px; margin-bottom: 1em; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.8048000335693px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" class="" id="yui_3_16_0_1_1416592596188_4342">So is there a way to make it more event driven with the avahi-daemon? I think from looking at the D-Bus API that might be the way to go?</div><div style="margin-top: 0px; margin-bottom: 1em; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.8048000335693px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" class="" id="yui_3_16_0_1_1416592596188_4342" dir="ltr">If it is the right approach, I would appreciate it if someone knew of a related chunk of source that I could use as a starting point.</div><div style="margin-top: 0px; margin-bottom: 1em; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.8048000335693px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" class="" id="yui_3_16_0_1_1416592596188_4342" dir="ltr"><br></div><div style="margin-top: 0px; margin-bottom: 1em; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.8048000335693px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" class="" id="yui_3_16_0_1_1416592596188_4342" dir="ltr">Thanks!</div><div style="margin-top: 0px; margin-bottom: 1em; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 17.8048000335693px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;" class="" id="yui_3_16_0_1_1416592596188_4342" dir="ltr">Jonathan</div><div class="" style="" id="yui_3_16_0_1_1416592596188_4343"><br class="" style=""></div></div></body></html>