1
0

tmux-clear-keys.sh 364 B

123456789101112
  1. #!/usr/bin/env bash
  2. # Wipe the keys after a specified delay, unless there are still tmux clients
  3. # attached.
  4. set -e
  5. #exec > >(tee -a /tmp/tmux-timer.log) 2>&1
  6. sleep "${1-0}"
  7. if [ $(tmux list-clients | wc -l) -eq 0 ]; then
  8. if which keyctl >/dev/null; then
  9. keyctl purge user
  10. fi
  11. SSH_AUTH_SOCK="/run/user/$(id -u)/openssh_agent" exec ssh-add -D
  12. fi