From 67cb1b092a05de99ed937a744682b6d5dc56bef0 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Tue, 7 Jun 2022 23:44:29 +0300 Subject: [PATCH] pve-primbra config --- .../Scripts/1.0.4/02.pve-primbra config.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.4/02.pve-primbra config.sql diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.4/02.pve-primbra config.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.4/02.pve-primbra config.sql new file mode 100644 index 0000000..1e93326 --- /dev/null +++ b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.4/02.pve-primbra config.sql @@ -0,0 +1,19 @@ +if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***') +begin + insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) + select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'The old ***REMOVED*** host and the first public server of the lab' +end + +declare @machine_id int, @server_performer_id int +select @machine_id = MachineId from Machine where MachineName = '***REMOVED***' +select @server_performer_id = PerformerId from PowerActionPerformer where PerformerCode = 'NETWORK_RESURRECTOR_SERVER' + +if not exists (select top 1 1 from PowerActionConfiguration where MachineId = @machine_id) +begin + insert into PowerActionConfiguration (MachineId, PowerActionId, PerformerId) + select @machine_id, + PowerActionId, + @server_performer_id + from PowerAction + where PowerActionCode in ('WAKE', 'PING') +end \ No newline at end of file