Have the Whitelist on by default on server start, and only open it automatically when the autostart is at 5minutes (make this configurable)
Whitelist should be on when you start the server, in terms of autostart unwhitelisting can look into that for sure.