license acti

This commit is contained in:
Yan
2017-12-01 15:19:24 +06:30
parent 7db4ace7b6
commit 4b7cced87c
2 changed files with 17 additions and 14 deletions

View File

@@ -204,7 +204,7 @@ class License
f.write("initial.load.create.first=true\n")
f.write("initial.load.use.extract.job.enabled=true\n")
f.close
byebug
# read from license file
shop_name = read_license("shop_name")
dbhost = read_license("dbhost")
@@ -213,7 +213,7 @@ byebug
dbpassword = read_license("dbpassword")
# shop properties create
f = File.open(sym_location + "/#{shop_name}.properties", "w")
f = File.open(sym_location + "engines/#{shop_name}.properties", "w")
f.write("engine.name=#{shop_name}\n")
f.write("db.driver=com.mysql.jdbc.Driver\n")
f.write("db.url=jdbc:mysql://#{dbhost}/#{dbschema}?tinyInt1isBit=false\n")
@@ -247,7 +247,7 @@ byebug
# if sym_install_status[1] == "false"
# response = { "status": false, "message": "Activation is success but Symmetric service not Installed. \n Please contact code2lab call center!"}
# end
byebug
# Run Sym Service
sym_run_status = check_sym_running(check_sym_proc_str, sym_path)
if sym_run_status
@@ -255,19 +255,22 @@ byebug
check_sym_table = system(sym_path + "bin/symadmin --engine sx create-sym-tables")
if check_sym_table
sym_sql = Rails.root + "db/sym_master.sql"
if File.exist? (sym_sql)
# Import Sym Sql to db and start sym
run_sym_sql = system(sym_path + "bin/dbimport --engine sx " + sym_sql)
run_sym = system(sym_path + "bin/sym")
run_sym_sql = system(sym_path + "bin/dbimport --engine sx " + sym_sql.to_s)
stop_sym = system("service SymmetricDS stop")
run_sym = system("service SymmetricDS start")
if run_sym
response = { "status": true, "message": "Activation is success and Configuration done..."}
end
else
response = { "status": false, "message": "Activation is success but Symmetric Sql not Found. \n Please contact code2lab call center!"}
response = { "status": false, "message": "Activation is success but Symmetric Sql not found. \n Please contact code2lab call center!"}
end
end
end
else
response = { "status": false, "message": "Activation is success but Symmetric not running. \n Please contact code2lab call center!"}
end
end
# Check Symmetric Running