use loops to install and generate the config file