Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Commit

Permalink
Edited README.md via GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Carver committed Sep 15, 2011
1 parent 6ed0d79 commit fa06565
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions README.md
Expand Up @@ -9,11 +9,51 @@ Based from author: Joseph Mocker, Sun Microsystems

---

# Usage
### Usage
Install this script as root

> `sudo ./INSTALL`
# Notes
---

### Notes
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"`
---

### Source

```#!/bin/bash
# Script: ssh-askpass
# Author: Mark Carver
# Created: 2011-09-14
# Copyright (c) 2011 Beyond Eden Development, LLC. All rights reserved.
# A ssh-askpass command for Mac OS X
# Based from author: Joseph Mocker, Sun Microsystems
# http://blogs.oracle.com/mock/entry/and_now_chicken_of_the
# 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"
TITLE="${SSH_ASKPASS_TITLE:-SSH}";
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[*]} "display dialog \"${@:-$TEXT}\" default answer \"\" with title \"${TITLE}\" with icon caution with hidden answer");
CODE=(${CODE[*]} "text returned of result");
CODE=(${CODE[*]} "end tell");
SCRIPT="/usr/bin/osascript"
for LINE in ${CODE[*]}; do
SCRIPT="${SCRIPT} -e $(printf "%q" "${LINE}")";
done;
eval "${SCRIPT}";```

0 comments on commit fa06565

Please sign in to comment.