Unmounting
This commit is contained in:
parent
1504a2f252
commit
89d2f139c0
|
@ -150,9 +150,10 @@ function search_for_attached_usb_drive {
|
||||||
if grep -Fxq "search_for_attached_usb_drive" $COMPLETION_FILE; then
|
if grep -Fxq "search_for_attached_usb_drive" $COMPLETION_FILE; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ -d $USB_DRIVE ]; then
|
if [ -b $USB_DRIVE ]; then
|
||||||
if [ ! -d /media/usb ]; then
|
if [ ! -d /media/usb ]; then
|
||||||
echo 'Mounting USB drive'
|
echo 'Mounting USB drive'
|
||||||
|
mkdir /media/usb
|
||||||
mount $USB_DRIVE /media/usb
|
mount $USB_DRIVE /media/usb
|
||||||
fi
|
fi
|
||||||
if [ -d /media/usb/Maildir ]; then
|
if [ -d /media/usb/Maildir ]; then
|
||||||
|
@ -201,6 +202,12 @@ function search_for_attached_usb_drive {
|
||||||
cp -r /media/usb/personal /home/$MY_USERNAME/personal
|
cp -r /media/usb/personal /home/$MY_USERNAME/personal
|
||||||
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/personal
|
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/personal
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
if [ -d /media/usb ]; then
|
||||||
|
umount /media/usb
|
||||||
|
rm -rf /media/usb
|
||||||
|
fi
|
||||||
|
echo 'No USB drive attached'
|
||||||
fi
|
fi
|
||||||
echo 'search_for_attached_usb_drive' >> $COMPLETION_FILE
|
echo 'search_for_attached_usb_drive' >> $COMPLETION_FILE
|
||||||
}
|
}
|
||||||
|
@ -1203,6 +1210,11 @@ function install_final {
|
||||||
if grep -Fxq "install_final" $COMPLETION_FILE; then
|
if grep -Fxq "install_final" $COMPLETION_FILE; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
# unmount any attached usb drive
|
||||||
|
if [ -d /media/usb ]; then
|
||||||
|
umount /media/usb
|
||||||
|
rm -rf /media/usb
|
||||||
|
fi
|
||||||
echo 'install_final' >> $COMPLETION_FILE
|
echo 'install_final' >> $COMPLETION_FILE
|
||||||
echo ''
|
echo ''
|
||||||
echo ' *** Freedombone installation is complete. Rebooting... ***'
|
echo ' *** Freedombone installation is complete. Rebooting... ***'
|
||||||
|
|
Loading…
Reference in New Issue