|
@@ -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
|