Bob Mottram 9 年 前
コミット
62be11f32c
共有3 個のファイルを変更した11 個の追加11 個の削除を含む
  1. 1
    1
      src/freedombone
  2. 9
    9
      src/freedombone-config
  3. 1
    1
      src/freedombone-recoverkey

+ 1
- 1
src/freedombone ファイルの表示

@@ -3820,7 +3820,7 @@ function backup_to_friends_servers {
3820 3820
       echo "            cd /home/$MY_USERNAME/.gnupg_fragments" >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3821 3821
       echo '            no_of_shares=$(ls -afq keyshare.asc.* | wc -l)' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3822 3822
       echo '            no_of_shares=$((no_of_shares - 2))' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3823
-      echo '            if [[ ${no_of_shares} > 0 ]]; then' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3823
+      echo '            if (( no_of_shares > 0 )); then' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3824 3824
       echo '                # Pick a share index based on the domain name' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3825 3825
       echo '                # This ensures that the same share is always given to the same domain' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
3826 3826
       echo '                sharenumstr=$(md5sum <<< "$REMOTE_DOMAIN")' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME

+ 9
- 9
src/freedombone-config ファイルの表示

@@ -233,10 +233,10 @@ function validate_domain_name {
233 233
   # count the number of dots in the domain name
234 234
   dots=${TEST_DOMAIN_NAME//[^.]}
235 235
   no_of_dots=${#dots}
236
-  if (( $no_of_dots > 3 )); then
236
+  if (( no_of_dots > 3 )); then
237 237
       TEST_DOMAIN_NAME="The domain $TEST_DOMAIN_NAME has too many subdomains. It should be of the type w.x.y.z, x.y.z or y.z"
238 238
   fi
239
-  if (( $no_of_dots == 0 )); then
239
+  if (( no_of_dots == 0 )); then
240 240
       TEST_DOMAIN_NAME="The domain $TEST_DOMAIN_NAME has no top level domain. It should be of the type w.x.y.z, x.y.z or y.z"
241 241
   fi
242 242
 }
@@ -254,7 +254,7 @@ function interactive_gpg_from_remote {
254 254
 
255 255
   # check the number of entries in the file
256 256
   no_of_servers=$(cat $REMOTE_SERVERS_LIST | wc -l)
257
-  if [[ ${no_of_servers} < 3 ]]; then
257
+  if (( no_of_servers < 3 )); then
258 258
       dialog --title "Encryption keys" \
259 259
              --msgbox 'There must be at least three servers to recover the key' 6 70
260 260
       return 2
@@ -278,9 +278,9 @@ function reconstruct_key {
278 278
         return
279 279
     fi
280 280
     cd /home/$MY_USERNAME/.gnupg_fragments
281
-    no_of_shares=$(ls -afq keyshare* | wc -l)
281
+    no_of_shares=$(ls -afq keyshare.asc.* | wc -l)
282 282
     no_of_shares=$((no_of_shares - 2))
283
-    if [[ ${no_of_shares} < 4 ]]; then
283
+    if (( no_of_shares < 4 )); then
284 284
         dialog --title "Encryption keys" --msgbox 'Not enough fragments to reconstruct the key' 6 70
285 285
         exit 7348
286 286
     fi
@@ -319,7 +319,7 @@ function interactive_gpg_from_usb {
319 319
       if [[ $INSTALLING_ON_BBB == "yes" ]]; then
320 320
           GPG_USB_DRIVE='/dev/sda1'
321 321
           if [ ! -b $GPG_USB_DRIVE ]; then
322
-              if [[ ${GPG_CTR} > 0 ]]; then
322
+              if (( GPG_CTR > 0 )); then
323 323
                   reconstruct_key
324 324
                   return 0
325 325
               fi
@@ -333,7 +333,7 @@ function interactive_gpg_from_usb {
333 333
               if [ ! -b $GPG_USB_DRIVE ]; then
334 334
                   GPG_USB_DRIVE='/dev/sdd1'
335 335
                   if [ ! -b $GPG_USB_DRIVE ]; then
336
-                      if [[ ${GPG_CTR} > 0 ]]; then
336
+                      if (( GPG_CTR > 0 )); then
337 337
                           reconstruct_key
338 338
                           return 0
339 339
                       fi
@@ -360,7 +360,7 @@ function interactive_gpg_from_usb {
360 360
       fi
361 361
       mount $GPG_USB_DRIVE $GPG_USB_MOUNT
362 362
       if [ ! "$?" = "0" ]; then
363
-          if [[ ${GPG_CTR} > 0 ]]; then
363
+          if (( GPG_CTR > 0 )); then
364 364
               rm -rf $GPG_USB_MOUNT
365 365
               reconstruct_key
366 366
               return 0
@@ -373,7 +373,7 @@ function interactive_gpg_from_usb {
373 373
 
374 374
       if [ ! -d $GPG_USB_MOUNT/.gnupg ]; then
375 375
           if [ ! -d $GPG_USB_MOUNT/.gnupg_fragments ]; then
376
-              if [[ ${GPG_CTR} > 0 ]]; then
376
+              if (( GPG_CTR > 0 )); then
377 377
                   umount -f $GPG_USB_MOUNT
378 378
                   rm -rf $GPG_USB_MOUNT
379 379
                   reconstruct_key

+ 1
- 1
src/freedombone-recoverkey ファイルの表示

@@ -129,7 +129,7 @@ fi
129 129
 cd $FRAGMENTS_DIR
130 130
 no_of_shares=$(ls -afq keyshare.asc.* | wc -l)
131 131
 no_of_shares=$((no_of_shares - 2))
132
-if [[ ${no_of_shares} == 0 ]]; then
132
+if (( no_of_shares == 0 )); then
133 133
     echo 'No key fragments were retrieved'
134 134
     exit 76882
135 135
 fi