]> git.sev.monster Git - dotfiles.git/blobdiff - base/.zlogout
gpg: expand forwarding, add default-recipient-self
[dotfiles.git] / base / .zlogout
index 249979ee5d2095864830abbc61c25ac4f768df74..3b09ce51f1e967e453dc7a8bc7d6dba5499b89f6 100644 (file)
@@ -1,2 +1,26 @@
-echo logout
+# gpg forward cleanup
+if [[ $SHLVL == 1 && $GNUPGHOME =~ '.ssh_forward/\d+$' ]] {
+    x=$GNUPGHOME
+    # reset GNUPGHOME
+    [[ -o GLOB_ASSIGN ]]; y=$?
+    setopt GLOB_ASSIGN
+    GNUPGHOME=$GNUPGHOME/../..(:a)
+    [[ $y != 0 ]] && unsetopt GLOB_ASSIGN
+    # clean dir if it exists
+    if [[ -d $x ]] {
+        find $x -mindepth 1 -maxdepth 1 | while read -r y; do
+            unlink $y
+        done
+        rmdir -p $x 2>/dev/null
+    }
+    # clean up any remaining sockets from gpg forwarding
+    rm -f $_GNUPG_SOCK_DEST_BASE*(N=)
+}
+
+[[ -o interactive ]] && echo logout
 clear
+
+### load site-specific
+if [[ -f ~/.zlogout.local ]] { source ~/.zlogout.local }
+
+# vim: set et sts=4 sw=4 ts=8 tw=79 :
This page took 0.045525 seconds and 4 git commands to generate.