瀏覽代碼

Move out of the target directory before unmounting

Bob Mottram 10 年之前
父節點
當前提交
b31a107de6
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5
    1
      src/freedombone-keydrive

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

132
 # make a directory to contain the fragments
132
 # make a directory to contain the fragments
133
 if [ ! -d $FRAGMENTS_DIR ]; then
133
 if [ ! -d $FRAGMENTS_DIR ]; then
134
   mkdir -p $FRAGMENTS_DIR
134
   mkdir -p $FRAGMENTS_DIR
135
+  echo "Made directory $FRAGMENTS_DIR"
135
 fi
136
 fi
136
 if [ ! -d $FRAGMENTS_DIR ]; then
137
 if [ ! -d $FRAGMENTS_DIR ]; then
137
   echo "There was a problem making the directory $FRAGMENTS_DIR"
138
   echo "There was a problem making the directory $FRAGMENTS_DIR"
170
 fi
171
 fi
171
 if (( no_of_local_shares < 3 )); then
172
 if (( no_of_local_shares < 3 )); then
172
     freedombone-splitkey -u $MY_USERNAME
173
     freedombone-splitkey -u $MY_USERNAME
173
-	cd $LOCAL_FRAGMENTS_DIR
174
+    cd $LOCAL_FRAGMENTS_DIR
174
     no_of_local_shares=$(ls -afq keyshare.asc.* | wc -l)
175
     no_of_local_shares=$(ls -afq keyshare.asc.* | wc -l)
175
     if [ ! "$?" = "0" ]; then
176
     if [ ! "$?" = "0" ]; then
176
         no_of_local_shares=0
177
         no_of_local_shares=0
196
 if (( no_of_usb_shares > 1 )); then
197
 if (( no_of_usb_shares > 1 )); then
197
     echo "Too many key fragments exist in $FRAGMENTS_DIR"
198
     echo "Too many key fragments exist in $FRAGMENTS_DIR"
198
     ls $FRAGMENTS_DIR
199
     ls $FRAGMENTS_DIR
200
+    cd ~/
199
     umount -f $USB_MOUNT
201
     umount -f $USB_MOUNT
200
     rm -rf $USB_MOUNT
202
     rm -rf $USB_MOUNT
201
     exit 54292
203
     exit 54292
203
 if (( no_of_usb_shares <= 0 )); then
205
 if (( no_of_usb_shares <= 0 )); then
204
     echo "There was a problem copying the key fragment to $USB_DRIVE"
206
     echo "There was a problem copying the key fragment to $USB_DRIVE"
205
     ls $FRAGMENTS_DIR
207
     ls $FRAGMENTS_DIR
208
+    cd ~/
206
     umount -f $USB_MOUNT
209
     umount -f $USB_MOUNT
207
     rm -rf $USB_MOUNT
210
     rm -rf $USB_MOUNT
208
     exit 54292
211
     exit 54292
209
 fi
212
 fi
213
+cd ~/
210
 umount -f $USB_MOUNT
214
 umount -f $USB_MOUNT
211
 rm -rf $USB_MOUNT
215
 rm -rf $USB_MOUNT
212
 echo "Key fragment copied to $USB_DRIVE. You may now remove the drive."
216
 echo "Key fragment copied to $USB_DRIVE. You may now remove the drive."