refactored setup script, same base as email server
update