OSA Assignment 2:Shell script to Mount & Unmount

By Mr. Pravin Kumar
function function1

{
printf " \n Displaying the list devices connected to your system\n"
df
}

function function2 
{
echo "Enter the device name to be mounted ";
read name ;
echo "Enter the path where  to be mounted ";
read path ;
printf "\n Mounting Device ";
mount -t vfat $name $path ;
}

function function3 
{
echo "Enter the device name to be unmounted ";
read name ;
umount $name ;
}

ans="y"
while [ $ans = "y" ]

do 

echo "**************menu***********"
echo "1. List of the devices connected to the system "
echo "2. Mount a device "
echo "3. Unmount a device "
echo "4. exit "

read choice ;

case $choice in 

1)
function1;;

2)
function2;;

3)
function3 ;;

4)
exit ;;

esac 

done
SHARE
    Blogger Comment
    Facebook Comment