Skip to content

Instantly share code, notes, and snippets.

@keks
Created January 30, 2013 13:00
Show Gist options
  • Save keks/4673133 to your computer and use it in GitHub Desktop.
Save keks/4673133 to your computer and use it in GitHub Desktop.
finding running ssh agents
#!/bin/sh
now=`date +%s`
stattime=`stat -c'%Z' /tmp/sshag.$USER`
uptime=`cat /proc/uptime | cut -d. -f1`
if [ 0 -lt $[ $now - $stattime - $uptime] ]; then
ssh-agent > /tmp/sshag.$USER
chmod 600 /tmp/sshag.$USER
fi
cat /tmp/sshag.keks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment