From c5fc9d2794d0ce9f4c0b5908a421bd2e159c5ff5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 4 Jul 2015 16:56:03 +0100 Subject: [PATCH] Brackets --- src/freedombone-keydrive | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/freedombone-keydrive b/src/freedombone-keydrive index 7777edf3..a6514ecf 100755 --- a/src/freedombone-keydrive +++ b/src/freedombone-keydrive @@ -146,7 +146,7 @@ if [ ! "$?" = "0" ]; then else no_of_usb_shares=$((no_of_usb_shares - 2)) 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" umount $USB_MOUNT rm -rf $USB_MOUNT @@ -167,7 +167,7 @@ if [ ! "$?" = "0" ]; then else no_of_local_shares=$((no_of_local_shares - 2)) fi -if [[ ${no_of_local_shares} < 3 ]]; then +if (( no_of_local_shares < 3 )); then freedombone-splitkey -u $MY_USERNAME no_of_local_shares=$(ls -afq $LOCAL_FRAGMENTS_DIR/keyshare.asc.* | wc -l) if [ ! "$?" = "0" ]; then @@ -178,8 +178,8 @@ if [[ ${no_of_local_shares} < 3 ]]; then no_of_local_shares=$((no_of_shares - 2)) fi -if [[ ${no_of_local_shares} < 3 ]]; then - echo 'Not enough key fragments available' +if (( no_of_local_shares < 3 )); then + echo "Not enough key fragments available ${no_of_local_shares}" umount $USB_MOUNT rm -rf $USB_MOUNT exit 63386 @@ -191,7 +191,7 @@ SHARE_FILENAME=${files[RANDOM % ${#share_files[@]}]} cp -f $SHARE_FILENAME $FRAGMENTS_DIR no_of_usb_shares=$(ls -afq $FRAGMENTS_DIR/keyshare.asc.* | wc -l) 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" umount $USB_MOUNT rm -rf $USB_MOUNT