This commit is contained in:
Bob Mottram 2015-07-04 16:56:03 +01:00
parent 2f431f77da
commit c5fc9d2794
1 changed files with 5 additions and 5 deletions

View File

@ -146,7 +146,7 @@ if [ ! "$?" = "0" ]; then
else else
no_of_usb_shares=$((no_of_usb_shares - 2)) no_of_usb_shares=$((no_of_usb_shares - 2))
fi fi
if [[ ${no_of_usb_shares} > 0 ]]; then if (( no_of_usb_shares > 0 )); then
echo "A key fragment already exists on the drive for the user $MY_USERNAME" echo "A key fragment already exists on the drive for the user $MY_USERNAME"
umount $USB_MOUNT umount $USB_MOUNT
rm -rf $USB_MOUNT rm -rf $USB_MOUNT
@ -167,7 +167,7 @@ if [ ! "$?" = "0" ]; then
else else
no_of_local_shares=$((no_of_local_shares - 2)) no_of_local_shares=$((no_of_local_shares - 2))
fi fi
if [[ ${no_of_local_shares} < 3 ]]; then if (( no_of_local_shares < 3 )); then
freedombone-splitkey -u $MY_USERNAME freedombone-splitkey -u $MY_USERNAME
no_of_local_shares=$(ls -afq $LOCAL_FRAGMENTS_DIR/keyshare.asc.* | wc -l) no_of_local_shares=$(ls -afq $LOCAL_FRAGMENTS_DIR/keyshare.asc.* | wc -l)
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
@ -178,8 +178,8 @@ if [[ ${no_of_local_shares} < 3 ]]; then
no_of_local_shares=$((no_of_shares - 2)) no_of_local_shares=$((no_of_shares - 2))
fi fi
if [[ ${no_of_local_shares} < 3 ]]; then if (( no_of_local_shares < 3 )); then
echo 'Not enough key fragments available' echo "Not enough key fragments available ${no_of_local_shares}"
umount $USB_MOUNT umount $USB_MOUNT
rm -rf $USB_MOUNT rm -rf $USB_MOUNT
exit 63386 exit 63386
@ -191,7 +191,7 @@ SHARE_FILENAME=${files[RANDOM % ${#share_files[@]}]}
cp -f $SHARE_FILENAME $FRAGMENTS_DIR cp -f $SHARE_FILENAME $FRAGMENTS_DIR
no_of_usb_shares=$(ls -afq $FRAGMENTS_DIR/keyshare.asc.* | wc -l) no_of_usb_shares=$(ls -afq $FRAGMENTS_DIR/keyshare.asc.* | wc -l)
no_of_usb_shares=$((no_of_usb_shares - 2)) no_of_usb_shares=$((no_of_usb_shares - 2))
if [[ ${no_of_usb_shares} != 1 ]]; then if (( no_of_usb_shares != 1 )); then
echo "There was a problem copying the key fragment to $USB_DRIVE" echo "There was a problem copying the key fragment to $USB_DRIVE"
umount $USB_MOUNT umount $USB_MOUNT
rm -rf $USB_MOUNT rm -rf $USB_MOUNT