repo: uritools
action: commit
revision: 
path_from: 
revision_from: 3e23d5631b7664de5a78aaaac211bff357152c00:
path_to: 
revision_to: 
git.thebackupbox.net
uritools
git clone git://git.thebackupbox.net/uritools
commit 3e23d5631b7664de5a78aaaac211bff357152c00
Author: epoch 
Date:   Mon Apr 20 03:15:36 2020 -0500

    uristart.conf-breaking changes by using urimatch instead of matching only on scheme

diff --git a/uristart b/uristart
index 4e9763389db2fb30ca4b6368dba1072f6f566973..
index ..d36764ff021c86848f280e7a7235bb93abe9498c 100755
--- a/uristart
+++ b/uristart
@@ -17,7 +17,29 @@ fi

 uri="${1}"
 scheme="$(printf "%s\n" "$uri" | uricut -s)"
-line="$(grep "^${scheme}:" ~/.config/uristart.conf | cut -d: -f2- | sed 's/^[ \t]*//g' | sed 's/\\/\\\\/g')"
+#line="$(grep "^${scheme}:" ~/.config/uristart.conf | cut -d: -f2- | sed 's/^[ \t]*//g' | sed 's/\\/\\\\/g')"
+
+line="$(
+cat ~/.config/uristart.conf \
+  | while read -r l;do
+	uritmp="$uri"
+	uritmp="$(printf "%s\n" "$l" \
+	  | cut -d: -f1 \
+          | tr ' ' '\n' \
+          | paste '-d ' - - \
+          | while read -r a b;do
+		uritmp="$(printf "%s\n" "${uritmp}" | urimatch "$a" "$b")"
+		printf "%s\n" "$uritmp"
+	    done | tail -n1)"
+	if [ "$uritmp" ];then
+		printf '%s\n' "$l"
+		break
+	fi
+    done \
+  | cut -d: -f2- \
+  | sed 's/^[ \t]*//g' \
+  | sed 's/\\/\\\\/g'
+)"

 ### if we do not have a port, we are going to try to get it from their srv records.
 if printf "%s\n" "$uri" | urimatch nP >/dev/null;then

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