diff options
author | rhatto <rhatto@ratatosk.fluxo.info> | 2014-03-14 13:26:20 -0300 |
---|---|---|
committer | rhatto <rhatto@ratatosk.fluxo.info> | 2014-03-14 13:26:20 -0300 |
commit | 36369a8bfb4fd15d70d61cb4af929ac1b94fed70 (patch) | |
tree | 7007dc84be9993c7e3604d634bc50c8d9aa4f932 /keyringer | |
parent | 4b4aff2edac956224849d36fe83f826303d25efd (diff) | |
parent | 38c1700e6e21d070c39e0e64127995b3246d7460 (diff) | |
download | keyringer-36369a8bfb4fd15d70d61cb4af929ac1b94fed70.tar.gz keyringer-36369a8bfb4fd15d70d61cb4af929ac1b94fed70.tar.bz2 |
Imported Upstream version 0.3.1upstream_keyringer_0.3.1
Diffstat (limited to 'keyringer')
-rwxr-xr-x | keyringer | 34 |
1 files changed, 28 insertions, 6 deletions
@@ -39,6 +39,18 @@ function keyringer_init { exit 1 fi + # Check user configuration: git might complain if those aren't set + if [ -z "`git config --global --includes --get user.name`" ] || [ -z "`git config --global --includes --get user.email`" ]; then + echo "No git config found, so please chose a name and email address to identify your changes in the new keyring repository." + read -p "Enter your desired name/pseudonym: " name + read -p "Enter your desired email address: " email + + if [ -z "$name" ] || [ -z "$email" ]; then + echo "Aborting." + exit 1 + fi + fi + # Setup if [ ! -z "$URL" ]; then git clone "$URL" "$BASEDIR" @@ -93,11 +105,15 @@ function keyringer_init { keyringer_exec git "$BASEDIR" init keyringer_git_ignore 'tmp/*' + # Git configuration + git config user.email "$email" + git config user.name "$name" + # Edit default recipients echo "Now you have to edit the default recipient configuration to be able to encrypt secrets." echo "Press any key to proceed editing..." read key - keyringer $KEYRING recipients edit default + keyringer_exec recipients "$BASEDIR" edit default # Stage and commit keyringer_exec git "$BASEDIR" add . @@ -122,7 +138,7 @@ function keyringer_dispatch { # Config NAME="keyringer" -KEYRINGER_VERSION="0.3" +KEYRINGER_VERSION="0.3.1" CONFIG_VERSION="0.1" CONFIG_BASE="$HOME/.$NAME" CONFIG="$CONFIG_BASE/config" @@ -161,14 +177,20 @@ fi # Load functions source "$LIB" || exit 1 +# Basic checks +if [ -z "$KEYRING" ]; then + keyringer_usage + exit 1 +elif [ ! -f "$CONFIG_BASE/$KEYRING" ] && [ "$ACTION" != "init" ]; then + echo "No such keyring $KEYRING" + exit 1 +fi + # Setup main configuration and load preferences keyringer_config_load # Dispatch -if [ -z "$KEYRING" ]; then - keyringer_usage - exit 1 -elif [ -z "$ACTION" ]; then +if [ -z "$ACTION" ]; then # Run shell if no action were given keyringer $KEYRING shell elif [ "$ACTION" == "init" ]; then |