Installatin of the script itself is easy - as any other script . Edit the values
you need (timers, users, ftp message). You will need to create directories named

/home/eggdrop/proftpd/
/home/eggdrop/proftpd-prev/

that will contain the access database - the script doesn't "remember" the access
table state, all is stored in these directories, as file "hour"<hournumber> that
contains users authorised at that hour. You can create them elsewhere, but make
sure to update the script paths, and that the directories are writable by the
user eggdrop runs under.

Also, you have to create an /etc/proftpd.allow file and add the following in
your /etc/proftpd.conf - of course, ajust this to your site needs :

<Anonymous ~ftpuser>

  AnonRequirePassword   on

  User			ftpuser
  Group			ftp

  Include /etc/proftpd.allow

</Anonymous>

this means that when allowing user "ftpuser" to access the ftp, proftpd will
also process the instructions in /etc/proftpd.allow. Our proftpd.allow will
unusally include the following :

<Limit LOGIN>
Order Allow, Deny
Allow allowed.hostname.or.ip # allowed-irc-nick
DenyAll
</Limit>

There will be one "Allow" line for every host allowed to connect with that user.

There are 2 modes that proftpd can run in : a standalone mode, where there one
proftpd deamon running, and every time a user connects to the server, another
process is spawned, using the same configuration as the master process, and an
inetd mode, where every time a user connects to the server, a new proftpd
process is started, reading the configuration from the config file.

If your proftpd is running in xinetd mode, you don't need root access to the
box, since you don't have to do anything to make the server to reload
configuration when changed; otherwise, you do need to have root access, to send
a HUP signal to master proftpd process when the config changes.

I wrote this script for a standalone proftpd machine, so i will explain that
scenario. Basically, every user that hits the LetMeIn trigger is checked if he
is on channel $ftp_channel. If he is not, he recieves an appropriate message,
and if he is, he is added to an appropriate file in /home/eggdrop/proftpd. A
trigger file is touched, and a crontab executed as root every minute
(update_ftp_access script) checks for the trigger, and if the file exist, all
files in /home/eggdrop/proftpd processed, all allowed users are extracted,
/etc/proftpd.allow is rebuilt, and HUP signal is sent to master proftpd process.
The procedure is similar if proftpd is running in xinetd mode, the only
difference that the minutely job will be ran under eggdrop user (or any other
account, the point is that no root access needed), since it doesn't have to HUP
proftpd when the config file changes (and of course you have to make sure that
the script can write to /etc/proftpd.allow).

Every hour another cronjob executed (see eggdrop_crontab), that will
check if there are users authorised more then 6 hours ago, and if there are such
files, they will be moved to proftpd-prev directory, for history perposes. Then
the files in history directory will be checked, and the ones more then 20 hours
old will be deleted. To change the timeouts edit the eggdrop_hourly_crontab
script. Be aware that users already on the ftp will not be kicked from it when
their allowed time frame expires, but thay will not be able to establish new
connections to the server - this is by design. If you need another behaivour,
you are welcome to update the script and send it to me.

Of course, you will need to setup the crontabs (root-crontab is the minutely
one, if your proftpd is running in standalone mode), it will need
update_ftp_access installed, and eggdrop_hourly_crontab, to hourly remove old
entries.








