On Fri, Nov 7, 2008 at 10:07 PM, Jim Meyering <span dir="ltr"><<a href="mailto:jim@meyering.net">jim@meyering.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">>>> +# check if we were called to attempt to default<br>
>>> +# to remote logging<br>
>>> +if [[ "$1" = "default" ]] ; then<br>
>>> +    printf "\nAttempting to locate remote syslog server..."<br>
>>> +    DEFAULT_SERVER=$(host -N 3 -t srv _syslog._udp | rev | awk '/VRS/ {print $1}' | cut -d. -f2- | rev)<br>
>>> +    DEFAULT_PORT=$(host -N 3 -t srv _syslog._udp | rev | awk '/VRS/ {print $2}' | cut -d. -f2- | rev)<br></div></blockquote><div><br>please use find_srv from ovirt-functions, see examples in other ovirt startup scripts.<br>
I'll add this doc comment in ovirt-functions to help it's reuse:<br># find_srv SERVICE PROTO<br># reads DNS SRV record<br># sets SRV_HOST and SRV_PORT if DNS SRV record found, clears them if not<br># example:<br># find_srv ovirt tcp<br>
# if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then<br>#   echo "oVirt Server found"<br># else<br>#   echo "no oVirt Server available, running standalone"<br>
# fi<br><br></div></div>