Bob Mottram 9 年之前
父節點
當前提交
c5fc9d2794
共有 1 個檔案被更改,包括 5 行新增5 行删除
  1. 5
    5
      src/freedombone-keydrive

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

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