This repository has been archived by the owner. It is now read-only.
Switch branches/tags
Nothing to show
Find file
4967e65 Nov 12, 2013
@markcarver @onlyhavecans
executable file 34 lines (30 sloc) 1.2 KB
# Script: ssh-askpass
# Author: Mark Carver
# Created: 2011-09-14
# Licensed under GPL 3.0
# A ssh-askpass command for Mac OS X
# Based from author: Joseph Mocker, Sun Microsystems
# To use this script:
# Install this script running INSTALL as root
# If you plan on manually installing this script, please note that you will have
# to set the following variable for SSH to recognize where the script is located:
# export SSH_ASKPASS="/path/to/ssh-askpass"
TEXT="$(whoami)'s password:";
IFS=$(printf "\n");
CODE=("on GetCurrentApp()");
CODE=(${CODE[*]} "tell application \"System Events\" to get short name of first process whose frontmost is true");
CODE=(${CODE[*]} "end GetCurrentApp");
CODE=(${CODE[*]} "tell application GetCurrentApp()");
CODE=(${CODE[*]} "activate");
CODE=(${CODE[*]} "display dialog \"${@:-$TEXT}\" default answer \"\" with title \"${TITLE}\" with icon caution with hidden answer");
CODE=(${CODE[*]} "text returned of result");
CODE=(${CODE[*]} "end tell");
for LINE in ${CODE[*]}; do
SCRIPT="${SCRIPT} -e $(printf "%q" "${LINE}")";
eval "${SCRIPT}";