Can specify the number of key fragments

This commit is contained in:
Bob Mottram 2015-09-29 12:37:02 +01:00
parent 427b034a92
commit 4b80624010
3 changed files with 9 additions and 4 deletions

Binary file not shown.

View File

@ -31,13 +31,14 @@
USB_DRIVE=/dev/sdb1
USB_MOUNT=/mnt/usb
KEY_FRAGMENTS=3
FRAGMENTS_DIR=$USB_MOUNT/.gnupg_fragments
MY_USERNAME=$USER
MASTER_DRIVE="no"
function show_help {
echo ''
echo 'freedombone-keydrive -u [username] -d [device, eg. sdb] --master [yes/no]'
echo 'freedombone-keydrive -u [username] -d [device, eg. sdb] --master [yes/no] -n [no of fragments]'
echo ''
exit 0
}
@ -62,6 +63,10 @@ case $key in
shift
MASTER_DRIVE="$1"
;;
-n|--fragments)
shift
KEY_FRAGMENTS=$1
;;
*)
# unknown option
;;
@ -158,7 +163,7 @@ fi
LOCAL_FRAGMENTS_DIR=/home/$MY_USERNAME/.gnupg_fragments
if [ ! -d $LOCAL_FRAGMENTS_DIR ]; then
freedombone-splitkey -u $MY_USERNAME
freedombone-splitkey -u $MY_USERNAME -n $KEY_FRAGMENTS
fi
cd $LOCAL_FRAGMENTS_DIR
@ -167,7 +172,7 @@ if [ ! "$?" = "0" ]; then
no_of_local_shares=0
fi
if (( no_of_local_shares < 3 )); then
freedombone-splitkey -u $MY_USERNAME
freedombone-splitkey -u $MY_USERNAME -n $KEY_FRAGMENTS
cd $LOCAL_FRAGMENTS_DIR
no_of_local_shares=$(ls -afq keyshare.asc.* | wc -l)
if [ ! "$?" = "0" ]; then

View File

@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<!-- 2015-09-29 Tue 12:21 -->
<!-- 2015-09-29 Tue 12:36 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org-mode" />
<meta name="author" content="Bob Mottram" />