summaryrefslogtreecommitdiff
path: root/contrib/whoisd/whoisd-cached.sh
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2018-07-07 23:07:29 +0000
committerepochqwert <epoch@hacking.allowed.org>2018-07-07 23:07:29 +0000
commit6a2ec4517a0c8ec70289823acbd130d520f1ce80 (patch)
treed13dd82d71f2d1f9ccdf84ec6f9244983216a123 /contrib/whoisd/whoisd-cached.sh
parent2b1915aa0f36a8883ad5b924907660325f24e2a4 (diff)
downloadresdb-6a2ec4517a0c8ec70289823acbd130d520f1ce80.tar.gz
resdb-6a2ec4517a0c8ec70289823acbd130d520f1ce80.zip
claimed n.ano for link shortener. some minor changes to whoisd and I guess pulled a new copy of marc.db.
Diffstat (limited to 'contrib/whoisd/whoisd-cached.sh')
-rwxr-xr-xcontrib/whoisd/whoisd-cached.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/whoisd/whoisd-cached.sh b/contrib/whoisd/whoisd-cached.sh
new file mode 100755
index 0000000..248fad6
--- /dev/null
+++ b/contrib/whoisd/whoisd-cached.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+cd /var/db/resdb
+commit=$(git log -1 | head -n1 | tr -cd 'a-f0-9')
+query=$(head -n1 | tr -cd 'a-zA-Z0-9.:_-')
+if ! cat "/var/cache/whois/${commit}-${query}" 2>/dev/null;then
+ printf "%s\n" "${query}" | /var/db/resdb/contrib/whoisd/whoisd.pl | tee "/var/cache/whois/${commit}-${query}"
+fi