repo: uritools
action: commit
revision: 
path_from: 
revision_from: 72faac1687e78cd88680fb15abd4f0eccf9ad85a:
path_to: 
revision_to: 
git.thebackupbox.net
uritools
git clone git://git.thebackupbox.net/uritools
commit 72faac1687e78cd88680fb15abd4f0eccf9ad85a
Author: epoch 
Date:   Sun Jun 15 04:18:03 2025 -0500

    put a help flag into getsrv

diff --git a/getsrv b/getsrv
index 58fb03b2d14fbc0d120c9d186c77aff9fad9dd45..
index ..d7fefbe406283ec445ed0bae8b274afd219061a8 100755
--- a/getsrv
+++ b/getsrv
@@ -1,5 +1,12 @@
 #!/usr/bin/env bash
-if [ "_$1" = '_-a' ];then
+
+### this -a isn't even used! what is it still here for?
+if [ "$1" = "-h" -o "$1" = "--help" ];then
+  printf "usage: getsrv [-a|--all|-h|--help]    [excluded-host1] [excluded-host2] [...]\n" >&2
+  printf "example getsrv xmpp-server tcp thebackupbox.net\n" >&2
+  exit 1
+fi
+if [ "$1" = "-a" -o "$1" = "--all" ];then
   head="uniq"
   shift
 else
@@ -7,19 +14,19 @@ else
 fi
 record="_$1._$2.$3"
 shift 3
-if [ "_$*" != "_" ];then
+if [ "_$*" != "_" ];then #what am I even using this for? it looks to be allowing me to match response with the extra... oh. this is to exclude already tried.
   filter='grep -vF "'"$(printf "%s\n" "$*" | tr ' ' '\n')"'"'
 else
   filter=cat
 fi
 if which host >/dev/null;then
-  host -t SRV "$record" | cut '-d ' -f5-
+  host -t SRV "$record" $dns_server | cut '-d ' -f5-
   #echo "after host" >&2
 elif which dig >/dev/null;then
-  dig +short -t SRV "$record" 
+  dig +short -t SRV "$record" $dns_server
   #echo "after dig" >&2
 else
-  echo "how am I supposed to get a srv record without dig or host? giving up." >&2
+  echo "getsrv: how am I supposed to get a srv record without dig or host? giving up." >&2
   exit 1
 fi | grep '^[0-9][0-9]* [0-9][0-9]*' \
   | sort -rn \

-----END OF PAGE-----