#! /bin/sh
# install FERRET links in the /usr/local/bin area - eliminating the need to
# modify the PATH variable
# ver 1.0 4/92 *sh* - based on INSTALL_BIN routine

# procedure options include
# "i" (install) - copies sources, links and other files to installation area
# "r" (remove)  - removes the "i" files

until [ "$activity" = "i" ] || [ "$activity" = "r" ] || [ "$activity" = "q" ]; do
   read -p "Install (i), remove (r), or quit (q)? " activity
   case "$activity" in
      "i")
         echo "Installing FERRET links"
         ;;
      "r")
         echo "Removing FERRET links"
         ;;
      "q")
         exit
         ;;
      *)
         echo "You must answer i, r, or q"
   esac
done

# basic definitions
source_area="$FER_DIR/bin"
dest_area="/usr/local/bin"

cd "$source_area"
for binfile in * ; do
   case "$activity" in
      "i")
         if ! echo $binfile | grep -q '~$' ; then
            ln -s "$source_area/$binfile" "$dest_area/$binfile"
         fi
         ;;
      "r")
         rm "$dest_area/$binfile"
         ;;
   esac
done

