makeaccess: fixes for when run by cron, cleanup, dependencies check and use of shared functions