view .sleep @ 199:6bfec0d0d020

Start an agent in there too, though I wonder if this would be better as a function...
author Steve Huston <huston@astro.princeton.edu>
date Wed, 30 Sep 2020 11:22:35 -0400
parents 2f9a3b4b6a01
children b00e6b403896
line wrap: on
line source

#!/bin/bash
# first, don't inherit a socket (sleepwatcher doesn't get the user's env)
SSH_AUTH_SOCK=

# find some sockets
for sock in /tmp/com.apple.launchd.*/Listeners /tmp/launch-*/Listeners; do
  if [ -w $sock ]; then
    echo "Trying to remove keys from socket $sock"
    SSH_AUTH_SOCK=$sock ssh-add -D
  fi  
done