002-domain-migration 324 B

123456789101112
  1. #!/usr/bin/lua
  2. local fs = require 'nixio.fs'
  3. local uci = require("simple-uci").cursor()
  4. local file = '/etc/config/currentsite'
  5. if fs.stat(file) then
  6. local domain = uci:get('currentsite', 'current', 'name')
  7. uci:set('gluon', 'core', 'domain', domain:match('^ffho_(.*)$') or domain)
  8. uci:save('gluon')
  9. fs.remove(file)
  10. end