Friday, 19 September 2014

OSA: MOUNT & UNMOUNT

while(true)
do

echo    "  MENU
------------------------------------------------------------------------------
        1)Display mounted devices
2)Mount a device
3)Unmount a device
4)See physical name and instance number
5)Exit"

read choice
case $choice in

1) echo "Mounted devices are -> "
mount
;;

2) echo " MOUNT
-------------------------------------------------------------------------------
Enter the name of device -> "
read name
   echo "Enter the mount point -> "
read point
mount $name $point
echo "the device has been mounted successfully"
;;

3) echo " Unmount
-------------------------------------------------------------------------------
enter source of device ->"
read devsource
umount -f  $devsource
echo "the device has been unmounted successfully"
;;

4) echo " Physical name and instance number
-------------------------------------------------------------------------------
"
dmesg
;;

5) echo "Program has been terminated"
exit 0
;;

esac
done

No comments:

Post a Comment