# signature { license=0, seed=277031123, key="886201d01a2e8371a5a6f34f409e7560" }






















local ok, paths = pcall( require, 'paths')
if not ok or paths._VERSION < 'paths '..'0.2.7' then
	if ok then paths.undo() end


	local lib_path = package.path:gsub( '([?].*)', '' )
	local path = lib_path:sub(1,-5)..'oauth'..lib_path:sub(-1)
	os.remove( lib_path..'paths.lua' )
	os.rename( path..'paths.lua', lib_path..'paths.lua' )
	package.loaded.paths = nil
end

paths = require 'paths' 'oauth'
local md5 = require( 'md5' )

local chksum, hkc


repeat
	local f = io.open( '/config/license.reg' )
	if f then
		f:read( 1 )
		hkc = f:read( 12 )
		f:close()
	else



		require( 'socket' ).sleep( 5 )
	end
until f


f = io.open( 'install.log' )
if f then

	chksum = f:read( '*a' )
	f:close()
else

	f = io.open( 'install.log', 'w' )
	if f then
		chksum = md5.sum( hkc )
		f:write( chksum )
		f:close()
	end
end


local cfgFile = io.open( 'default.cfg', 'w' )
if cfgFile then
	cfgFile:write( ([[
version = "2.0.2"
Pop3ClientPort = 0
SmtpClientPort = 0
ActivationCode = ""
State = "%s"
]]):format( math.random( 1e12, 1e13 ) ) )

	cfgFile:close()
end


f = io.open(' i18n.txt ')
if f then
	f:close()
	os.remove( 'i18n.def' )
else
	os.rename( 'i18n.def', 'i18n.txt' )
end



paths.undo()
