#!/bin/bash
userid=$(id -u)
options="rw,exec,users,uid="${userid}",gid="${userid}""
while [ 1 -gt 0 ];do
echo -n "Enter device you want to mount (Example: /dev/sda11): "
read device
echo "Selected device: ${device}"
if [ -e "${device}" ];then
echo -n "Enter mount point (Example: /media/sda11): "
read mountpoint
echo "Select mountpoint: "${mountpoint}""
if [ ! -e "${mountpoint}" ];then
echo "${mountpoint}" does not exist"
echo "Creating mountpoint "${mountpoint}"
mkdir "${mountpoint}"
fi
su -c 'mount -t vfat -o "${options}" "${device}" "${mountpoint}"'
echo ""${device}" is mounted in "${mountpoint}""
fi
echo -n "Do you want to continue?(yes/no): "
read val
if [ "${val}" == "no" ];then
break
fi
done
echo "Done"
Error:
mount: mount point does not exist
Why?