"Events and Messages : Proactive" - Deny access to the server outside specified hours
Event in zFTPServer:
BeforeConnect
Script in zFTPServer:
C:\Scripts\OfficeHours.bat
Error message in zFTPServer:
You're not allowed to login outside office hours.
Contents of file "C:\Scripts\OfficeHours.bat":
@echo off
rem Extract current hour
for /f "tokens=1-2 delims=: " %%a in ('time/t') do (
set hour=%%a
set minute=%%b
)
rem Deny access outside office hours
if /I %hour% LSS 8 exit 1
if /I %hour% GEQ 18 exit 1