From 036cd2a6a347bccc69ef52521d22eaf6eda0b619 Mon Sep 17 00:00:00 2001 From: akpaevj Date: Sat, 17 Feb 2024 23:19:54 +0300 Subject: [PATCH] t --- .vscode/launch.json | 26 +++++- Helpers/BatchMode.sbsl => BatchMode.sbsl | 63 +++++-------- build_xml_files.sbsl => EDT.sbsl | 8 +- Helpers/IO.sbsl | 62 ------------- Helpers/ProcessHelper.sbsl | 18 ---- IO.sbsl | 58 ++++++++++++ Ibsrv.sbsl | 77 ++++++++++++++++ Helpers/Net.sbsl => Net.sbsl | 0 Processes.sbsl | 91 +++++++++++++++++++ Helpers/Ras.sbsl => Ras.sbsl | 0 Services.sbsl | 51 +++++++++++ Helpers/SqlUtil.sbsl => Sql.sbsl | 0 ...Connection.sbsl => SshAgentConnection.sbsl | 0 Helpers/V8Util.sbsl => V8.sbsl | 21 ++++- Yaml.sbsl | 26 ++++++ Zip.sbsl | 21 +++++ block_connections.sbsl | 28 ------ create_database_from_backup.sbsl | 14 --- unblock_connections.sbsl | 25 ----- update_configuration.sbsl | 26 ------ update_extension.sbsl | 28 ------ 21 files changed, 392 insertions(+), 251 deletions(-) rename Helpers/BatchMode.sbsl => BatchMode.sbsl (50%) rename build_xml_files.sbsl => EDT.sbsl (90%) delete mode 100644 Helpers/IO.sbsl delete mode 100644 Helpers/ProcessHelper.sbsl create mode 100644 IO.sbsl create mode 100644 Ibsrv.sbsl rename Helpers/Net.sbsl => Net.sbsl (100%) create mode 100644 Processes.sbsl rename Helpers/Ras.sbsl => Ras.sbsl (100%) create mode 100644 Services.sbsl rename Helpers/SqlUtil.sbsl => Sql.sbsl (100%) rename Helpers/SshAgentConnection.sbsl => SshAgentConnection.sbsl (100%) rename Helpers/V8Util.sbsl => V8.sbsl (73%) create mode 100644 Yaml.sbsl create mode 100644 Zip.sbsl delete mode 100644 block_connections.sbsl delete mode 100644 create_database_from_backup.sbsl delete mode 100644 unblock_connections.sbsl delete mode 100644 update_configuration.sbsl delete mode 100644 update_extension.sbsl diff --git a/.vscode/launch.json b/.vscode/launch.json index d8d5dfd..d6c463e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,13 +10,29 @@ "request": "launch", "scriptFile": "${file}", "args": [ - "localhost", - "erp_dev", - "sa", - "1qazxsw@", - "erv_dev_test" + "8.3.23.2040", + "W228\\USR1CV8", + "N3Ak8bPu7", + "erp_main_extension_2765112a", + "C:\\Users\\akpaev.e\\Desktop\\erp-ibsrv-config.yml" ] // "args": [ + // "C:\\Users\\akpaev.e\\Desktop\\erp-ibsrv-config2.yml", + // "http.http-services.service.name", + // "testvalue" + // ] + // "args": [ + // "update_extension.sbsl", + // "script.sbsl" + // ] + // "args": [ + // "localhost", + // "erp_dev", + // "sa", + // "1qazxsw@", + // "erv_dev_test" + // ] + // "args": [ // "localhost", // "erp_tehnogerm_test_update", // "Администратор", diff --git a/Helpers/BatchMode.sbsl b/BatchMode.sbsl similarity index 50% rename from Helpers/BatchMode.sbsl rename to BatchMode.sbsl index 1c83023..98c0748 100644 --- a/Helpers/BatchMode.sbsl +++ b/BatchMode.sbsl @@ -1,18 +1,20 @@ -#required ProcessHelper.sbsl -#required V8Util.sbsl +#required Processes.sbsl +#required V8.sbsl @Global method UpdateConfiguration( - Platform: V8Util.V8Platform, + PlatformVersion: String, Server: String, Infobase: String, User: String, Password: String, AccessCode: String, CfuPath: String): Number + val Platform = V8.GetInstalledPlatform(PlatformVersion) + val OutFile = Files.CreateTempFile() - val args = [ + val Args = [ "DESIGNER", "/S${Server}\\${Infobase}", "/N${User}", @@ -28,30 +30,16 @@ method UpdateConfiguration( "-Server", "-SessionTerminate force" ] - val Process = new OsProcess(Platform.ExecutablePath, args, True) - Process.Start() - ProcessHelper.WaitForCompletionAndReadOutput(Process) - Process.Stop() + + val ExitCode = Processes.Run(Platform.ExecutablePath, Args) + RedirectOutToConsole(OutFile) - var ExitCode = Process.GetExitCode() - if ExitCode > 0 - Console.WriteError("Failed to update infobase (${ExitCode})") - else - Console.Write("${Infobase} is successfully updated") - ; - - use OutputStream = OutFile.OpenReadableStream() - val OutputStreamText = OutputStream.ReadAsString() - if (OutputStreamText.Length() > 0) - Console.Write(OutputStreamText) - ; - - return Process.GetExitCode() + return ExitCode ; @Global method UpdateExtension( - Platform: V8Util.V8Platform, + PlatformVersion: String, Server: String, Infobase: String, User: String, @@ -59,9 +47,11 @@ method UpdateExtension( AccessCode: String, ExtensionName: String, ExtensionArchive: String): Number + val Platform = V8.GetInstalledPlatform(PlatformVersion) + val OutFile = Files.CreateTempFile() - val args = [ + val Args = [ "DESIGNER", "/S${Server}\\${Infobase}", "/N${User}", @@ -78,23 +68,18 @@ method UpdateExtension( "-Server", "-SessionTerminate force" ] - val Process = new OsProcess(Platform.ExecutablePath, args, True) - Process.Start() - ProcessHelper.WaitForCompletionAndReadOutput(Process) - Process.Stop() + + val ExitCode = Processes.Run(Platform.ExecutablePath, Args) + RedirectOutToConsole(OutFile) - var ExitCode = Process.GetExitCode() - if ExitCode > 0 - Console.WriteError("Failed to update extension ${ExtensionName} in ${Infobase}") - else - Console.Write("Extension \"${ExtensionName}\" in ${Infobase} is successfully updated") - ; + return ExitCode +; +method RedirectOutToConsole(OutFile: File) use OutputStream = OutFile.OpenReadableStream() - val OutputStreamText = OutputStream.ReadAsString() - if (OutputStreamText.Length() > 0) - Console.Write(OutputStreamText) - ; + val OutputStreamContent = OutputStream.ReadAsString() - return Process.GetExitCode() + if (OutputStreamContent.Length() > 0) + Console.Write(OutputStreamContent) + ; ; \ No newline at end of file diff --git a/build_xml_files.sbsl b/EDT.sbsl similarity index 90% rename from build_xml_files.sbsl rename to EDT.sbsl index 72e6cef..fc119fd 100644 --- a/build_xml_files.sbsl +++ b/EDT.sbsl @@ -1,9 +1,9 @@ -#required Helpers/V8Util.sbsl +#required IO.sbsl +#required Zip.sbsl -method Script( +method BuildXmlFiles( CliPath: String, ProjectPath: String): Number - if not IO.PathExists(CliPath) Console.WriteError("Couldn't find edt cli executable by passed path") return 1 @@ -35,7 +35,7 @@ method Script( Files.Delete(DataPath) val ArchivePath = IO.JoinPath(new File(ProjectPath).Directory.Path, "${new File(ProjectPath).Name}.zip") - IO.ZipFolder(BuildPath, ArchivePath) + Zip.ZipFolder(BuildPath, ArchivePath) Files.Delete(BuildPath) diff --git a/Helpers/IO.sbsl b/Helpers/IO.sbsl deleted file mode 100644 index aba8067..0000000 --- a/Helpers/IO.sbsl +++ /dev/null @@ -1,62 +0,0 @@ -@Global -method GetFileName(Path: String): String - return new File(Path).Name -; - -@Global -method GetParentDirectory(Path: String): String - return new File(Path).Directory.Path -; - -@Global -method JoinPath(path: String, path1: String): String - if path.EndsWith("\\") or path.EndsWith("//") - return path + path1 - else - return path + Files.SeparatorSymbol + path1 - ; -; - -@Global -method JoinPath(path: String, path1: String, path2: String): String - val result = JoinPath(path, path1) - return JoinPath(result, path2) -; - -@Global -method JoinPath(path: String, path1: String, path2: String, path3: String): String - val result = JoinPath(path, path1, path2) - return JoinPath(result, path3) -; - -@Global -method PathExists(path: String): Boolean - return new File(path).Exists() -; - -@Global -method TempPath(): String - return ExecutionEnvironment.GetProperty("java.io.tmpdir") -; - -@Global -method ZipFolder(Folder: File, ArchivePath: String) - val ArchiveFile = new File(ArchivePath) - var Writer = new ZipWriter(ArchiveFile.OpenWritableStream()) - - for F in Folder.Children - AddToZipArchive(Writer, F, Folder) - ; - - Writer.Write() -; - -method AddToZipArchive(Writer: ZipWriter, Source: File, Folder: File) - if Source.IsFile() - Writer.Add(Source.OpenReadableStream(), Source.Path.Replace(Folder.Path, "")) - ; - - for F in Source.Children - AddToZipArchive(Writer, F, Folder) - ; -; \ No newline at end of file diff --git a/Helpers/ProcessHelper.sbsl b/Helpers/ProcessHelper.sbsl deleted file mode 100644 index 8cf09c1..0000000 --- a/Helpers/ProcessHelper.sbsl +++ /dev/null @@ -1,18 +0,0 @@ -@Global -method WaitForCompletionAndReadOutput(Process: OsProcess): Boolean - use ProcessOutputStream = Process.GetOutputStream() - - while True - val ProcessOutputText = ProcessOutputStream.ReadAsString() - - if (ProcessOutputText.Length() > 0) - Console.Write(ProcessOutputText) - ; - - if not Process.IsAlive() - break - ; - ; - - return Process.WaitForCompletion() -; \ No newline at end of file diff --git a/IO.sbsl b/IO.sbsl new file mode 100644 index 0000000..d8b953c --- /dev/null +++ b/IO.sbsl @@ -0,0 +1,58 @@ +@Global +method GetFileName(Path: String): String + return new File(Path).Name +; + +@Global +method GetParentDirectory(Path: String): String + return new File(Path).Directory.Path +; + +@Global +method JoinPath(Path: String, Path1: String): String + if Path.EndsWith("\\") or Path.EndsWith("/") + return Path + Path1 + else + return Path + Files.SeparatorSymbol + Path1 + ; +; + +@Global +method JoinPath(Path: String, Path1: String, Path2: String): String + val result = JoinPath(Path, Path1) + return JoinPath(result, Path2) +; + +@Global +method JoinPath(Path: String, Path1: String, Path2: String, Path3: String): String + val result = JoinPath(Path, Path1, Path2) + return JoinPath(result, Path3) +; + +@Global +method PathExists(Path: String): Boolean + return new File(Path).Exists() +; + +@Global +method TempPath(): String + return ExecutionEnvironment.GetProperty("java.io.tmpdir") +; + +@Global +method ReadFileToEnd(FilePath: String): String + val File = new File(FilePath) + use Stream = File.OpenReadableStream() + + return Stream.ReadAsString() +; + +@Global +method WriteTextToFile(FilePath: String, Content: String) + val File = new File(FilePath) + use Stream = File.OpenWritableStream() + + Stream.Flush() + + Stream.Write(Content) +; \ No newline at end of file diff --git a/Ibsrv.sbsl b/Ibsrv.sbsl new file mode 100644 index 0000000..a73d5ee --- /dev/null +++ b/Ibsrv.sbsl @@ -0,0 +1,77 @@ +#required IO.sbsl +#required V8.sbsl +#required Processes.sbsl +#required Services.sbsl +#required Yaml.sbsl + +const SERVICE_NAME_TEMPLATE = "Standalone server" +const SERVICE_DESC_TEMPLATE = "Standalone server 1C:Enterprise 8.3" + +@Global +method RegisterService( + PlatformVersion: String, + ServiceUser: String, + ServicePassword: String, + InstanceId: String, + TemplateConfigPath: String, + Port: Number = 8314, + DataPath: String = ""): Number + Processes.ThrowIfHasNoAdminRights() + + val Platform = V8.GetInstalledPlatform(PlatformVersion) + V8.ThrowIfHasNoStandaloneServer(Platform) + + if DataPath.Length() == 0 + DataPath = GetServerDataPath(InstanceId) + ; + + val ServiceName = GetServiceName(InstanceId) + val ServiceDesc = GetServiceDescription(InstanceId) + + val NewConfigPath = IO.JoinPath(IO.GetParentDirectory(TemplateConfigPath), "${InstanceId}.yaml") + Files.Copy(TemplateConfigPath, NewConfigPath) + Yaml.ReplaceValue(NewConfigPath, "infobase.name", InstanceId) + Yaml.ReplaceValue(NewConfigPath, "database.name", InstanceId) + Yaml.ReplaceValue(NewConfigPath, "server.port", Port.ToString().Replace(" ", "")) + + val BinPath = GetServiceBinPath(Platform, NewConfigPath, DataPath) + + return Services.Create(ServiceName, BinPath, ServiceUser, ServicePassword, ServiceDesc) +; + +@Global +method StartService(InstanceId: String): Number + val ServiceName = GetServiceName(InstanceId) + return Services.Start(ServiceName, True) +; + +@Global +method StopService(InstanceId: String): Number + val ServiceName = GetServiceName(InstanceId) + return Services.Stop(ServiceName, True) +; + +@Global +method RemoveService(InstanceId: String): Number + val ServiceName = GetServiceName(InstanceId) + return Services.Remove(ServiceName, True) +; + +method GetServerDataPath(InstanceId: String): String + return IO.JoinPath(ExecutionEnvironment.GetVariable("APPDATA"), "StandaloneService${Files.SeparatorSymbol}${InstanceId}") +; + +method GetServiceBinPath( + Platform: V8.V8Platform, + ConfigPath: String, + DataPath: String = ""): String + return "\\\"${Platform.IbsrvPath}\\\" --service --data=\\\"${DataPath}\\\" --config=\\\"${ConfigPath}\\\"" +; + +method GetServiceName(InstanceId: String): String + return "${SERVICE_NAME_TEMPLATE} ${InstanceId}" +; + +method GetServiceDescription(InstanceId: String): String + return "${SERVICE_DESC_TEMPLATE} (${InstanceId})" +; \ No newline at end of file diff --git a/Helpers/Net.sbsl b/Net.sbsl similarity index 100% rename from Helpers/Net.sbsl rename to Net.sbsl diff --git a/Processes.sbsl b/Processes.sbsl new file mode 100644 index 0000000..2fe33c6 --- /dev/null +++ b/Processes.sbsl @@ -0,0 +1,91 @@ +@Global +method Run( + Command: String, + Arguments: Array, + RedirectOutputToConsole: Boolean = True, + LifeRedirect: Boolean = True, + WaitCompletion: Boolean = True, + OutputEncoding: Encoding = Encoding.Utf8): Number + val Process = new OsProcess(Command, Arguments) + return Run(Process, RedirectOutputToConsole, LifeRedirect, WaitCompletion, OutputEncoding) +; + +@Global +method Run( + Process: OsProcess, + RedirectOutputToConsole: Boolean = True, + LifeRedirect: Boolean = True, + WaitCompletion: Boolean = True, + OutputEncoding: Encoding = Encoding.Utf8): Number + Process.Start() + + if RedirectOutputToConsole and LifeRedirect + RedirectOutputWhileAlive(Process, OutputEncoding) + ; + + if WaitCompletion + Process.WaitForCompletion() + ; + + if RedirectOutputToConsole and not LifeRedirect + WriteOutputToConsole(Process, OutputEncoding) + ; + + if WaitCompletion + return Process.GetExitCode() + else + return 0 + ; +; + +@Global +method RedirectOutputWhileAlive(Process: OsProcess, Encoding: Encoding = Encoding.Utf8) + use ProcessOutputStream = Process.GetOutputStream() + + while True + val ProcessOutputText = ProcessOutputStream.ReadAsString(Encoding) + + if (ProcessOutputText.Length() > 0) + Console.Write(ProcessOutputText) + ; + + if not Process.IsAlive() + break + ; + ; +; + +@Global +method WriteOutputToConsole(Process: OsProcess, Encoding: Encoding = Encoding.Utf8) + val Output = GetProcessOutput(Process, Encoding) + Console.Write(Output) +; + +@Global +method GetProcessOutput(Process: OsProcess, Encoding: Encoding = Encoding.Utf8): String + use ProcessOutputStream = Process.GetOutputStream() + return ProcessOutputStream.ReadAsString(Encoding) +; + +@Global +method HasAdminRights(): Boolean + val Process = new OsProcess("net", ["session"]) + Process.Start() + Process.WaitForCompletion() + + use OutputStream = Process.GetOutputStream() + val Output = OutputStream.ReadAsString(Encoding.Cp866) + + val HasNo = Output.Contains("Отказано в доступе") or Output.Contains("Access denied") + + return not HasNo +; + +@Global +method ThrowIfHasNoAdminRights() + val Has = HasAdminRights() + + if not Has + throw new IllegalStateException("Current user doesn't have admin rights") + ; +; \ No newline at end of file diff --git a/Helpers/Ras.sbsl b/Ras.sbsl similarity index 100% rename from Helpers/Ras.sbsl rename to Ras.sbsl diff --git a/Services.sbsl b/Services.sbsl new file mode 100644 index 0000000..f13ee12 --- /dev/null +++ b/Services.sbsl @@ -0,0 +1,51 @@ +#required Processes.sbsl + +@Global +enum ServiceStartMode + Disabled, + Auto +; + +@Global +method Create( + ServiceName: String, + BinPath: String, + User: String, + Password: String, + ServiceDescription: String = "", + StartMode: ServiceStartMode = ServiceStartMode.Auto, + RedirectOutputToConsole: Boolean = True): Number + var Start = "auto" + + if StartMode == ServiceStartMode.Disabled + Start = "disabled" + ; + + var Args = "/C sc create \"${ServiceName}\" binPath= \"${BinPath}\" start= ${Start} obj= ${User} password= ${Password}" + + if ServiceDescription.Length() > 0 + Args = "${Args} displayname= \"${ServiceDescription}\"" + ; + + return Processes.Run("cmd", [Args], RedirectOutputToConsole = RedirectOutputToConsole, OutputEncoding = Encoding.Cp866) +; + +@Global +method Start(ServiceName: String, RedirectOutputToConsole: Boolean = True): Number + return Processes.Run("cmd", ["/C sc start \"${ServiceName}\""], RedirectOutputToConsole = RedirectOutputToConsole, OutputEncoding = Encoding.Cp866) +; + +@Global +method Stop(ServiceName: String, RedirectOutputToConsole: Boolean = True): Number + return Processes.Run("cmd", ["/C sc stop \"${ServiceName}\""], RedirectOutputToConsole = RedirectOutputToConsole, OutputEncoding = Encoding.Cp866) +; + +@Global +method Remove(ServiceName: String, RedirectOutputToConsole: Boolean = True): Number + return Processes.Run("cmd", ["/C sc delete \"${ServiceName}\""], RedirectOutputToConsole = RedirectOutputToConsole, OutputEncoding = Encoding.Cp866) +; + +@Global +method ServiceExists(ServiceName: String): Boolean + return Processes.Run("cmd", ["/C sc query \"${ServiceName}\""], RedirectOutputToConsole = False, OutputEncoding = Encoding.Cp866) == 0 +; \ No newline at end of file diff --git a/Helpers/SqlUtil.sbsl b/Sql.sbsl similarity index 100% rename from Helpers/SqlUtil.sbsl rename to Sql.sbsl diff --git a/Helpers/SshAgentConnection.sbsl b/SshAgentConnection.sbsl similarity index 100% rename from Helpers/SshAgentConnection.sbsl rename to SshAgentConnection.sbsl diff --git a/Helpers/V8Util.sbsl b/V8.sbsl similarity index 73% rename from Helpers/V8Util.sbsl rename to V8.sbsl index be6caee..d67b059 100644 --- a/Helpers/V8Util.sbsl +++ b/V8.sbsl @@ -1,4 +1,4 @@ -#required IO.sbsl +#required IO.sbsl #required Net.sbsl @Global @@ -16,6 +16,13 @@ method GetInstalledPlatforms(): Array item.Architecture = Arch.X64 item.BinPath = IO.JoinPath(children.Path, "bin") item.ExecutablePath = IO.JoinPath(item.BinPath, "1cv8.exe") + + val ibsrvExecutable = new File(IO.JoinPath(item.BinPath, "ibsrv.exe")) + if ibsrvExecutable.Exists() + item.HasStandaloneServer = True + item.IbsrvPath = ibsrvExecutable.Path + item.IbcmdPath = IO.JoinPath(item.BinPath, "ibcmd.exe") + ; Items.Add(item) ; @@ -34,7 +41,7 @@ method GetInstalledPlatform(Version: String = ""): V8Platform? @Global method GetHighestInstalledPlatform(): V8Platform? - val platforms = V8Util.GetInstalledPlatforms() + val platforms = V8.GetInstalledPlatforms() return platforms.Last() ; @@ -71,10 +78,20 @@ method WaitSshAgentIsStarted(Port: Number = 1545, TimoutSeconds: Number): Boolea return Net.LocalPortIsOpen(Port, TimoutSeconds) ; +@Global +method ThrowIfHasNoStandaloneServer(Platform: V8Platform) + if not Platform.HasStandaloneServer + throw new IllegalStateException("Platform installation doesn't contains standalone server executable") + ; +; + @Global structure V8Platform var Version: String = "" var Architecture: Arch = Arch.X64 var BinPath: String = "" var ExecutablePath: String = "" + var HasStandaloneServer: Boolean = False + var IbsrvPath: String = "" + var IbcmdPath: String = "" ; \ No newline at end of file diff --git a/Yaml.sbsl b/Yaml.sbsl new file mode 100644 index 0000000..667109f --- /dev/null +++ b/Yaml.sbsl @@ -0,0 +1,26 @@ +#required IO.sbsl + +@Global +method ReplaceValue(FilePath: String, KeyPath: String, Value: String) + var FileContent = IO.ReadFileToEnd(FilePath) + + var PathParts = KeyPath.Split(".") + var IndexInContent = 0 + for Index = 0 to PathParts.Bound() + if (Index == PathParts.Bound()) + break + ; + + val Part = PathParts[Index] + val ToFindSpan = "${Part}:" + IndexInContent = FileContent.Find("${ToFindSpan}", IndexInContent) + ; + + val ToFindSpan = "${PathParts[PathParts.Bound()]}:" + val LastPartStartIndex = FileContent.Find(ToFindSpan, IndexInContent) + val LastPartEndIndex = FileContent.Find("\n", LastPartStartIndex) + var NewData = "${ToFindSpan} ${Value}" + + FileContent = FileContent.ReplaceRange(NewData, LastPartStartIndex, LastPartEndIndex) + IO.WriteTextToFile(FilePath, FileContent) +; \ No newline at end of file diff --git a/Zip.sbsl b/Zip.sbsl new file mode 100644 index 0000000..d82fbb5 --- /dev/null +++ b/Zip.sbsl @@ -0,0 +1,21 @@ +@Global +method ZipFolder(Folder: File, ArchivePath: String) + val ArchiveFile = new File(ArchivePath) + var Writer = new ZipWriter(ArchiveFile.OpenWritableStream()) + + for F in Folder.Children + AddToZipArchive(Writer, F, Folder) + ; + + Writer.Write() +; + +method AddToZipArchive(Writer: ZipWriter, Source: File, Folder: File) + if Source.IsFile() + Writer.Add(Source.OpenReadableStream(), Source.Path.Replace(Folder.Path, "")) + ; + + for F in Source.Children + AddToZipArchive(Writer, F, Folder) + ; +; \ No newline at end of file diff --git a/block_connections.sbsl b/block_connections.sbsl deleted file mode 100644 index 28725ed..0000000 --- a/block_connections.sbsl +++ /dev/null @@ -1,28 +0,0 @@ -#required Helpers/Ras.sbsl - -method Script( - Infobases: String, - User: String, - Password: String, - AccessPort: String, - RasAddress = "localhost", - RasPort = 1545): Number - - for i in Infobases.Split(",") - try - Ras.BlockConnections( - i, - User, - Password, - AccessPort, - RasAddress, - RasPort) - - Console.Write("Connections to ${i} are successfully blocked and terminated") - catch Exception: unknown - Console.WriteError("Failed to block connections to ${i}") - ; - ; - - return 0 -; \ No newline at end of file diff --git a/create_database_from_backup.sbsl b/create_database_from_backup.sbsl deleted file mode 100644 index 4b9b7df..0000000 --- a/create_database_from_backup.sbsl +++ /dev/null @@ -1,14 +0,0 @@ -#required Helpers/SqlUtil.sbsl - -method Script( - Server: String, - Database: String, - User: String, - Password: String, - NewDatabaseName: String) - try - SqlUtil.CreateDatabaseFromLastBackup(Server, Database, User, Password, NewDatabaseName) - catch Exception: unknown - Console.WriteError("Failed to restore database ${NewDatabaseName} from ${Database} backup: ${Exception.ToString()}") - ; -; \ No newline at end of file diff --git a/unblock_connections.sbsl b/unblock_connections.sbsl deleted file mode 100644 index f2ed982..0000000 --- a/unblock_connections.sbsl +++ /dev/null @@ -1,25 +0,0 @@ -#required Helpers/Ras.sbsl - -method Script( - Infobases: String, - User: String, - Password: String, - RasAddress = "localhost", - RasPort = 1545): Number - - for i in Infobases.Split(",") - try - Ras.UnblockConnections( - i, - User, - Password, RasAddress, - RasPort) - - Console.Write("Connections to ${i} are successfully unblocked") - catch Exception: unknown - Console.WriteError("Failed to unblock connections to ${i}") - ; - ; - - return 0 -; \ No newline at end of file diff --git a/update_configuration.sbsl b/update_configuration.sbsl deleted file mode 100644 index ebdebcc..0000000 --- a/update_configuration.sbsl +++ /dev/null @@ -1,26 +0,0 @@ -#required Helpers/V8Util.sbsl -#required Helpers/BatchMode.sbsl -#required Helpers/Ras.sbsl - -method Script( - Server: String, - Infobases: String, - User: String, - Password: String, - AccessCode: String, - CfuPath: String, - PlatfromVersion = "") - - val installedPlatform = V8Util.GetInstalledPlatform(PlatfromVersion) - - for i in Infobases.Split(",") - BatchMode.UpdateConfiguration( - installedPlatform, - Server, - i, - User, - Password, - AccessCode, - CfuPath) - ; -; \ No newline at end of file diff --git a/update_extension.sbsl b/update_extension.sbsl deleted file mode 100644 index e972800..0000000 --- a/update_extension.sbsl +++ /dev/null @@ -1,28 +0,0 @@ -#required Helpers/V8Util.sbsl -#required Helpers/BatchMode.sbsl -#required Helpers/Ras.sbsl - -method Script( - Server: String, - Infobases: String, - User: String, - Password: String, - AccessCode: String, - ExtensionName: String, - ExtensionArchive: String, - PlatfromVersion = "") - - val installedPlatform = V8Util.GetInstalledPlatform(PlatfromVersion) - - for i in Infobases.Split(",") - BatchMode.UpdateExtension( - installedPlatform, - Server, - i, - User, - Password, - AccessCode, - ExtensionName, - ExtensionArchive) - ; -; \ No newline at end of file