

if [ "$1" = "" ]
then
  echo "
    usage $0 username
  
    This script performs the operations necesssary to set up a
    guest ftp account for somebody who will be working as a 
    web developer or designer. However, it is still necessary at the moment
    to set the password for the guest ftp user with the 
    passwd command, after this script has run

    It probably also should make a change to the /etc/wu-ftpd/ftpaccess
    file, by adding some line such as:
      Class	ftpext	guest	vanessa,	nick
    although I believe that the syntax of this line is not correct.
    In addition, the 'guest ftp' HOWTO document which is located at
      http://www.wu-ftpd.org/
    mentioned alternative ways of setting up 'guest ftp access'
    In order to delete a user type
      deluser --remove-home theUserName
     "
  exit 1;
fi

newUserName="webdeveloper"
#-- newUserName=$1 && (echo "usage: ./make-ftp-guest.sh username"; exit 1)
adduser --shell /etc/ftponly --ingroup lusers --gecos $newUserName --disabled-login $newUserName
cp /etc/passwd /etc/passwd.old
#cat /etc/passwd.old | sed "s/home\/$newUserName/&\/\.\//g" > /etc/passwd
cp -r -p /var/guest-ftp-setup/* /var/www/
cd /home/$newUserName/

#-- The line below was a attempt to allow a guest ftp user to 
#-- over-come his/her chrooting by adding a symbolic link but
#-- the chrooting doesn't allow this.

#ln -s /var/www/ ella-web
echo "
  Now you can set the password manually with the command:

  passwd $newUserName 

  Once you have set the password for this user, you (or the user)
  will be able to login to the ftp server at
    www.ella-associates.org
  using the user-name and password which have just been established.

  If you would like to remove the user who has been created with this
  script, you can type the command

  deluser --remove-home $newUserName "

