diff options
Diffstat (limited to 'helpers/append-location')
-rwxr-xr-x | helpers/append-location | 10 |
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 |