  #!/bin/sh
  # ftprc V3.0 Bernhard Hailer 08-Sep-96
  #
  # Usage: ftprc /path/file server : creates a .netrc file and sends it
  #        ftprc get               : retrieves the desired file.

  ARGV=$1
  FILE_SERVER=$2

  . /etc/i4l.config
#  . /etc/i4l.param 

  
  if [ -z $FILE_SERVER ]

  then

    case $ARGV in
      get)
      ;;
    *)
      echo -e "\aUsage:"
      echo "ftprc /path/file server : creates .netrc, sends and executes it"
      echo "ftprc get               : gets retrieved file(s)"
    esac

  else

    # FILE_SERVER string ok?
    if [ {$FILE_SERVER} = 'basename $FILE_SERVER' ] *** Hier ist ein Hund drin!
    then    

      # Parse the ARGV string:
      FILE_NAME='basename $ARGV'
      FILE_PATH='dirname $ARGV'

      # Is there already a .ftprc file?
      if [ -e ~/.ftprc ]
      then
        echo -e "\n" >>~/.ftprc
      else
        touch ~/.ftprc 
      fi
     
      # Ok, now create the entry:
      echo -e "machine ftp.leo.org\n" >>~/.ftprc
      echo -e "  login anonymous\n" >>~/.ftprc
      echo -e "  password $MY_EMAIL_ADDRESS\n" >>~/.ftprc
      echo -e "  macdef init\n" >>~/.ftprc
      echo -e "  lcd /usr/src\n" >>~/.ftprc
      echo -e "  cd /pub/comp/os/linux/Linus/v2.0\n" >>~/.ftprc
      echo -e "  bin\n" >>~/.ftprc
      echo -e "  get linux-2.0.7.tar.gz\n" >>~/.ftprc
      echo -e "  close\n" >>~/.ftprc
      echo -e "  quit\n" >>~/.ftprc

    else 
      echo -e "\aUsage:"
      echo "ftprc /path/file server : creates .netrc, sends and executes it"
      echo "ftprc get               : gets retrieved file(s)"
      
    fi

  fi




