diff --git a/csharp/App/Backend/Controller.cs b/csharp/App/Backend/Controller.cs index 81953bc22..fa8113e7b 100644 --- a/csharp/App/Backend/Controller.cs +++ b/csharp/App/Backend/Controller.cs @@ -625,7 +625,7 @@ public class Controller : ControllerBase if (installationToUpdate != null) { - _ = session.RunScriptInBackground(installationToUpdate.VpnIp, batteryNode,version); + _ = session.RunScriptInBackground(installationToUpdate.VpnIp, batteryNode,version,installationToUpdate.Product); } return Ok(); diff --git a/csharp/App/Backend/DataTypes/Methods/Session.cs b/csharp/App/Backend/DataTypes/Methods/Session.cs index 5824c9602..cba4852cc 100644 --- a/csharp/App/Backend/DataTypes/Methods/Session.cs +++ b/csharp/App/Backend/DataTypes/Methods/Session.cs @@ -68,10 +68,12 @@ public static class SessionMethods .Apply(Db.Update); } - public static async Task RunScriptInBackground(this Session? session, String vpnIp, Int64 batteryNode,String version) + public static async Task RunScriptInBackground(this Session? session, String vpnIp, Int64 batteryNode,String version,Int64 product) { Console.WriteLine("-----------------------------------Start updating firmware-----------------------------------"); - string scriptPath = "/home/ubuntu/backend/uploadBatteryFw/update_firmware.sh"; + string scriptPath = (product == 0) + ? "/home/ubuntu/backend/uploadBatteryFw/update_firmware_Salimax.sh" + : "/home/ubuntu/backend/uploadBatteryFw/update_firmware_Salidomo.sh"; await Task.Run(() => {