소스 검색

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