|
@@ -4,9 +4,17 @@ local fs = require 'nixio.fs'
|
|
|
local uci = require("simple-uci").cursor()
|
|
|
|
|
|
local file = '/etc/config/currentsite'
|
|
|
+
|
|
|
+if not uci:get('gluon', 'core') then
|
|
|
+ uci:section('gluon', 'core', 'core')
|
|
|
+end
|
|
|
+if uci:get('gluon', 'system') then
|
|
|
+ uci:delete('gluon', 'system')
|
|
|
+end
|
|
|
if fs.stat(file) then
|
|
|
local domain = uci:get('currentsite', 'current', 'name')
|
|
|
uci:set('gluon', 'core', 'domain', domain:match('^ffho_(.*)$') or domain)
|
|
|
- uci:save('gluon')
|
|
|
fs.remove(file)
|
|
|
end
|
|
|
+
|
|
|
+uci:save('gluon')
|