Bob Mottram 9 年前
父节点
当前提交
c5fc9d2794
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5
    5
      src/freedombone-keydrive

+ 5
- 5
src/freedombone-keydrive 查看文件

146
 else
146
 else
147
     no_of_usb_shares=$((no_of_usb_shares - 2))
147
     no_of_usb_shares=$((no_of_usb_shares - 2))
148
 fi
148
 fi
149
-if [[ ${no_of_usb_shares} > 0 ]]; then
149
+if (( no_of_usb_shares > 0 )); then
150
   echo "A key fragment already exists on the drive for the user $MY_USERNAME"
150
   echo "A key fragment already exists on the drive for the user $MY_USERNAME"
151
   umount $USB_MOUNT
151
   umount $USB_MOUNT
152
   rm -rf $USB_MOUNT
152
   rm -rf $USB_MOUNT
167
 else
167
 else
168
     no_of_local_shares=$((no_of_local_shares - 2))
168
     no_of_local_shares=$((no_of_local_shares - 2))
169
 fi
169
 fi
170
-if [[ ${no_of_local_shares} < 3 ]]; then
170
+if (( no_of_local_shares < 3 )); then
171
     freedombone-splitkey -u $MY_USERNAME
171
     freedombone-splitkey -u $MY_USERNAME
172
     no_of_local_shares=$(ls -afq $LOCAL_FRAGMENTS_DIR/keyshare.asc.* | wc -l)
172
     no_of_local_shares=$(ls -afq $LOCAL_FRAGMENTS_DIR/keyshare.asc.* | wc -l)
173
     if [ ! "$?" = "0" ]; then
173
     if [ ! "$?" = "0" ]; then
178
     no_of_local_shares=$((no_of_shares - 2))
178
     no_of_local_shares=$((no_of_shares - 2))
179
 fi
179
 fi
180
 
180
 
181
-if [[ ${no_of_local_shares} < 3 ]]; then
182
-    echo 'Not enough key fragments available'
181
+if (( no_of_local_shares < 3 )); then
182
+    echo "Not enough key fragments available ${no_of_local_shares}"
183
     umount $USB_MOUNT
183
     umount $USB_MOUNT
184
     rm -rf $USB_MOUNT
184
     rm -rf $USB_MOUNT
185
     exit 63386
185
     exit 63386
191
 cp -f $SHARE_FILENAME $FRAGMENTS_DIR
191
 cp -f $SHARE_FILENAME $FRAGMENTS_DIR
192
 no_of_usb_shares=$(ls -afq $FRAGMENTS_DIR/keyshare.asc.* | wc -l)
192
 no_of_usb_shares=$(ls -afq $FRAGMENTS_DIR/keyshare.asc.* | wc -l)
193
 no_of_usb_shares=$((no_of_usb_shares - 2))
193
 no_of_usb_shares=$((no_of_usb_shares - 2))
194
-if [[ ${no_of_usb_shares} != 1 ]]; then
194
+if (( no_of_usb_shares != 1 )); then
195
     echo "There was a problem copying the key fragment to $USB_DRIVE"
195
     echo "There was a problem copying the key fragment to $USB_DRIVE"
196
     umount $USB_MOUNT
196
     umount $USB_MOUNT
197
     rm -rf $USB_MOUNT
197
     rm -rf $USB_MOUNT