Extract access rules to own setup script
Add shebang and error check to access script
Extract postgresql configuration updates