Write configuration file