summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkeyringer18
1 files changed, 17 insertions, 1 deletions
diff --git a/keyringer b/keyringer
index da87678..161ab5e 100755
--- a/keyringer
+++ b/keyringer
@@ -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 --get user.name`" ] || [ -z "`git config --global --get user.email`" ]; then
+ echo "Please chose the name and email address that should identify your changes in the new keyring."
+ 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,6 +105,10 @@ 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..."
@@ -161,7 +177,7 @@ fi
# Load functions
source "$LIB" || exit 1
-# Check if keyring exist
+# Check if keyring exists
if [ ! -f "$CONFIG_BASE/$KEYRING" ] && [ "$ACTION" != "init" ]; then
echo "No such keyring $KEYRING"
exit 1