add backend codes for upload bms firmware
This commit is contained in:
parent
abe69193e2
commit
7f5ea79d16
|
@ -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();
|
||||
|
|
|
@ -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(() =>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue