From 936a10a153e9cbf7d89e338632d14038102c06cb Mon Sep 17 00:00:00 2001 From: Brendan Thompson Date: Fri, 11 Apr 2014 14:39:02 +1000 Subject: [PATCH 1/3] using openssl to generate random password this resolves #11 --- keycrypt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/keycrypt b/keycrypt index a766f73..4b2e8bd 100755 --- a/keycrypt +++ b/keycrypt @@ -5,7 +5,7 @@ ########################################################################################## VERSION="0.1.0" -TMP_PASS="bubbl3s" +TMP_PASS="" GKEY="" OLD_KEY="" @@ -239,6 +239,10 @@ function askCopyPubKey() { esac } +function generatePassword() { + TMP_PASS=$(openssl rand -base64 128) +} + function usage() { cat < Date: Fri, 11 Apr 2014 15:31:44 +1000 Subject: [PATCH 2/3] Resolves #11 and #10 --- keycrypt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/keycrypt b/keycrypt index 4b2e8bd..bd95f5c 100755 --- a/keycrypt +++ b/keycrypt @@ -239,6 +239,12 @@ function askCopyPubKey() { esac } +function checkApplicationInstalled() { + local APP=$1 + + command -v $APP >/dev/null 2>&1 || { echo >&2 "I require $APP but it's not installed. Aborting."; exit 1; } +} + function generatePassword() { TMP_PASS=$(openssl rand -base64 128) } @@ -267,14 +273,16 @@ EOF ################################## Entry Point ################################## ########################################################################################## +checkApplicationInstalled "openssl" generatePassword + case $1 in "hello" ) echo "Hello, $2" ;; [tT][eE][sS][tT] ) #test - echo "$TMP_PASS" + checkApplicationInstalled "foo" ;; [cC][rR][eE][aA][tT][eE] | [cC][rR] ) #create defaultKeyLocation $2 From ea427aa323c7a2b42fb4c6f778f77ee70033fadb Mon Sep 17 00:00:00 2001 From: Brendan Thompson Date: Fri, 11 Apr 2014 15:32:18 +1000 Subject: [PATCH 3/3] Version bump --- keycrypt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keycrypt b/keycrypt index bd95f5c..465fec5 100755 --- a/keycrypt +++ b/keycrypt @@ -4,7 +4,7 @@ ################################# Global Variables ################################# ########################################################################################## -VERSION="0.1.0" +VERSION="0.1.1" TMP_PASS="" GKEY="" OLD_KEY=""