diff --git a/app/models/license.rb b/app/models/license.rb index ffc19d06..bece2adb 100755 --- a/app/models/license.rb +++ b/app/models/license.rb @@ -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 diff --git a/config/license.yml b/config/license.yml index c577c480..52e6160c 100644 --- a/config/license.yml +++ b/config/license.yml @@ -1,12 +1,12 @@ -iv_key: E0/gk/s6POeZtUae1QGo8g== -shop_name: R6s4J457+8FD1pycH5vl9g== +iv_key: bcXKbfOW+r64ibYXA4fU6g== +shop_name: Riz05xEt2Pc/tvyGjcnTnw== email: yanaung.nyein@code2lab.com telephone: 111111 fax: 111111 address: bitp -dbhost: A5OOsy/OEnIoMiqHNgrl8A== -dbschema: YfkMWJWhzPwt8GDFukk3dA== -dbusername: wcWA1CIUTq5NNIqmdAW79A== -dbpassword: I6t1lEqagOTQe1u87YPJJA== +dbhost: SMRuRTn59zAHEEdafri+Dg== +dbschema: iV7J64u6z9rqg5OFhf3OSw== +dbusername: gPg1PsWxrLNr/JXsmAch0A== +dbpassword: Xdq1p/jiewvgdG6LBAtRpw== api_token: nGyMizHtoVEFYCjSVEFJuzkxuBJwSsH app_token: QUdPwSakcsnuVLdfkXgGHhPMiIOcSSfaVwQyA