Created
September 29, 2013 14:41
-
-
Save piger/6753069 to your computer and use it in GitHub Desktop.
Lazy SSH Agent notification utility for OS X.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Lazy SSH Agent notification utility for OS X. | |
# | |
# Instead of asking the user for the confirmation to use a ssh key this script | |
# will just show a notification in Notification Center. | |
# | |
# Install as /usr/libexec/ssh-askpass | |
# | |
# Requires: terminal-notifier - https://github.com/alloy/terminal-notifier | |
set -e | |
TERMINAL_NOTIFIER="/Users/sand/Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier" | |
MESSAGE=$(echo $@ | perl -e '@m=<>; $key = $1 if $m[0] =~ m@(/[^\?]+)@m; $fp = $1 if $m[0] =~ m/fingerprint (.*)/m; print "$key: $fp";') | |
$TERMINAL_NOTIFIER -activate "com.apple.Terminal" -title "SSH Agent is using a key" -message "$MESSAGE" > /dev/null 2>&1 & | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment