summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-09-27 21:30:53 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-09-27 21:30:53 +0200
commit581224a29867864e6b6714d147b8b7b7107d7e7f (patch)
tree3be17020c4585f7891a8617d46831fe38d48d3a4 /helpers
parent6b3a1f55ff23e5a888994737d2b64f9ebbd7c08d (diff)
locationfoo is back. whee.
Diffstat (limited to 'helpers')
-rwxr-xr-xhelpers/append-location10
1 files changed, 10 insertions, 0 deletions
diff --git a/helpers/append-location b/helpers/append-location
new file mode 100755
index 0000000..0e1af89
--- /dev/null
+++ b/helpers/append-location
@@ -0,0 +1,10 @@
+#!/bin/zsh
+
+lastloc=$(tail -n 1 ~/var/log/location)
+newloc=$1
+
+if echo $lastloc | fgrep -q $newloc; then
+ exit 0
+fi
+
+printf "%s %-10s %s\n" "$(date -R)" $newloc $SSH_CLIENT[(w)1] >> ~/var/log/location