Guest User

Untitled

a guest
Feb 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. config = ConfigParser.RawConfigParser()
  2.  
  3. if not os.path.exists('/etc/plugui.conf'):
  4. config.add_section('Global')
  5. config.set('Global', 'host', '0.0.0.0')
  6. config.set('Global', 'port', '80')
  7. config.set('Global', 'server_name', 'localhost')
  8. config.set('Global', 'threads', '10')
  9. config.set('Global', 'daemonize', True)
  10. config.set('Global', 'workdir', '/opt/PlugUI')
  11. config.set('Global', 'pypath', '/opt')
  12. config.set('Global', 'pidfile', '/var/run/PlugUI/server.pid')
  13. config.set('Global', 'server_user', 'root')
  14. config.set('Global', 'server_group', 'root')
  15.  
  16. with open('/etc/plugui.conf', 'wb') as configfile:
  17. config.write(configfile)
  18.  
  19. else:
  20. config.readfp(open('/etc/plugui.conf'))
Add Comment
Please, Sign In to add comment