Преглед изворни кода

Don't copy key fragment to drive if it already contains a full keyring

Bob Mottram пре 9 година
родитељ
комит
fc45a596a6
1 измењених фајлова са 9 додато и 0 уклоњено
  1. 9
    0
      src/freedombone-keydrive

+ 9
- 0
src/freedombone-keydrive Прегледај датотеку

@@ -127,6 +127,15 @@ if [[ $MASTER_DRIVE == "yes" || $MASTER_DRIVE == "y" || $MASTER_DRIVE == "1" ]];
127 127
   exit 0
128 128
 fi
129 129
 
130
+# Don't use the USB drive if it already contains a full keyring
131
+if [ -d $USB_MOUNT/.gnupg ]; then
132
+  echo 'A full GPG keyring already exists on the USB drive.'
133
+  echo 'Either reformat the USB drive or use a different drive.'
134
+  umount -f $USB_MOUNT
135
+  rm -rf $USB_MOUNT
136
+  exit 3392
137
+fi
138
+
130 139
 # Append the username as a subdirectory.
131 140
 # This has a down side in that it does identify a given fragment
132 141
 # as belonging to a given user, but has the convenience upside