diff options
Diffstat (limited to 'share')
-rwxr-xr-x | share/keyringer/newkeys | 15 | ||||
-rwxr-xr-x | share/keyringer/options | 9 | ||||
-rwxr-xr-x | share/keyringer/recipients | 9 | ||||
-rwxr-xr-x | share/keyringer/recrypt | 1 |
4 files changed, 8 insertions, 26 deletions
diff --git a/share/keyringer/newkeys b/share/keyringer/newkeys index c7eb562..eff529e 100755 --- a/share/keyringer/newkeys +++ b/share/keyringer/newkeys @@ -3,14 +3,6 @@ # Create keys for new nodes. # -# Load functions -LIB="`dirname $0`/../../lib/keyringer/functions" -source $LIB -keyringer_set_env $* - -# Aditional parameters -COMMAND="$2" - function newkeys_nodes { # See http://www.mail-archive.com/puppet-users@googlegroups.com/msg01615.html grep ^node $* | sed -e 's/^node //' | awk -F, '{for(i=1;i<=NF;i++) {print $i}}' | cut -d "'" -f2 @@ -45,11 +37,10 @@ function newkeys_puppet { # Load functions LIB="`dirname $0`/../../lib/keyringer" source $LIB/functions +keyringer_set_env $* -if [ -z "$COMMAND" ]; then - echo "Usage: keyringer <keyring> `basename $0` <command> [arguments]" - exit 1 -fi +# Command parser +keyringer_get_command $2 source $OPTIONS keyringer_config_load_preferences diff --git a/share/keyringer/options b/share/keyringer/options index 4fe8092..6708b54 100755 --- a/share/keyringer/options +++ b/share/keyringer/options @@ -8,13 +8,8 @@ LIB="`dirname $0`/../../lib/keyringer" source $LIB/functions keyringer_set_env $* -# Aditional parameters -COMMAND="$2" - -if [ -z "$COMMAND" ]; then - echo "Usage: keyringer <keyring> `basename $0` <command> [arguments]" - exit 1 -fi +# Command parser +keyringer_get_command $2 # Create options file if old repository if [ ! -e "$OPTIONS" ]; then diff --git a/share/keyringer/recipients b/share/keyringer/recipients index 3410b3d..36eefcc 100755 --- a/share/keyringer/recipients +++ b/share/keyringer/recipients @@ -8,13 +8,8 @@ LIB="`dirname $0`/../../lib/keyringer" source $LIB/functions keyringer_set_env $* -# Aditional parameters -COMMAND="$2" - -if [ -z "$COMMAND" ]; then - echo "Usage: keyringer <keyring> `basename $0` <command> [arguments]" - exit 1 -fi +# Command parser +keyringer_get_command $2 if [ "$COMMAND" == "ls" ]; then cat $RECIPIENTS diff --git a/share/keyringer/recrypt b/share/keyringer/recrypt index 92afa99..a45efa1 100755 --- a/share/keyringer/recrypt +++ b/share/keyringer/recrypt @@ -11,4 +11,5 @@ keyringer_set_env $* # Get file keyringer_get_file $2 +# Recrypt gpg --use-agent -d $KEYDIR/$FILE | gpg --use-agent --armor -e -s $(keyringer_recipients $RECIPIENTS) > $KEYDIR/$FILE |