summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2019-11-17 02:13:33 -0600
committerepoch <epoch@hacking.allowed.org>2019-11-17 02:13:33 -0600
commit7fb85b98ac81064a38632e1501b72818fcc00f89 (patch)
tree7ef0dc453c9275121c76f85318d0edd50ec28711
parentc91aa0ac9f6c177d4b8079c052f2d88b74c55956 (diff)
downloaduritools-7fb85b98ac81064a38632e1501b72818fcc00f89.tar.gz
uritools-7fb85b98ac81064a38632e1501b72818fcc00f89.zip
made uristart log $2 along with the uri so you can have tags or a "referer" in your logs
-rwxr-xr-xuristart9
1 files changed, 8 insertions, 1 deletions
diff --git a/uristart b/uristart
index 08eede3..4ff1056 100755
--- a/uristart
+++ b/uristart
@@ -1,4 +1,7 @@
#!/bin/bash
+### arguments:
+# $1: the URI we're starting
+# $2: the "referer" of the URI we're starting.
##might have to configure me.
ASKUSER="dmenu -p"
uri="${1}"
@@ -50,7 +53,11 @@ scheme="$(printf "%s\n" "$uri" | uricut -s)"
## uri *might* contain pattern matching special characters. :/
## which could break things in weird and exciting ways
if ! cut '-d ' -f1 ~/.cache/uristart.log | grep -Fx "$uri" 2>&1 >/dev/null;then #only log URIs that aren't already listed
- printf "%s\n" "$uri" >> ~/.cache/uristart.log
+ if [ "$2" ];then
+ printf "%s %s\n" "$uri" "$2" >> ~/.cache/uristart.log
+ else
+ printf "%s\n" "$uri" >> ~/.cache/uristart.log
+ fi
fi
eval "$(printf "%s\n" "$uri" | sed 's/'\''/'\''\\'\'''\''/g' | uriprintf "$line")"
#fi