#!/bin/sh
##########################################################################
#
#  Set up the paralell-port Iomega Zip 100
#  This is by no means a guarantee to get your drive working, but it SHOULD
#  work in most cases.
#  If you want more help, read the ZIP-drive-HowTo.(www.ldp.org)
#
###########################################################################

clear

echo " Checking if the parport is set up..."
/sbin/modprobe parport
echo " Installing Iomega driver...(ppa)"
/sbin/modprobe ppa

echo " Now we need a  mountpoint for the drive."

echo -n " May I create /mnt/zip for you ? [y/n]: "
read choice
case  $choice in
  y)
     mkdir /mnt/zip
     ;;
  n)
     echo " Ok, but be sure to create a mountpoint later."
     ;;
  *)
     echo " Please, y or n only."
     ;;
esac


echo -n " Do you want me to add the correct entry in /etc/fstab for you ?
[y/n]: "
read choice
case $choice in
  y)
     echo "/dev/sda4     /mnt/zip    auto  noauto,user  0  0" >> /etc/fstab
     ;;
  n)
     echo " If you want to mount it regularily you should add it to your
fstab.."
     ;;
  *)
     echo" Please, y or n only."
esac

echo -n " shall I mount the drive for you ? [y/n]: "
read choice
case $choice in
  y)
      mount /mnt/zip
      ;;
  n)
      echo " Ok, As you wish !"
      ;;
  *)
     echo" Please, y or n only."
esac


echo -n " You should add the appropriate entries in /etc/rc.d/rc.local,
 so that your drive will remain functional after a reboot."
echo -n " Shall I do this now ? [y/n]: "
read choice
case $choice in
  y)
     echo "/sbin/modprobe parport && /sbin/modprobe ppa" >> /etc/rc.d/rc.local
     ;;
  n)

     echo " You can allways rerun this script later !"
     ;;
  *)
     echo" Please, y or n only."
esac

echo " "
echo " To mount and umount your drive, just do: mount /mnt/zip, umount zip.
 If you chose to make a dir for yourself just replace with the correct
 path. If you chose not to add any entries to /etc/fstab you have to mount
 the drive (assuming it uses windows-formated disks) like this:

 mount /dev/sda4 -t vfat /your_mount_dir/ (and you will have to be root)"


echo " That's it ! All done."



 
