Update firmware on backend
This commit is contained in:
parent
ce12d6a59a
commit
2851e34e47
|
@ -2,6 +2,7 @@ using System.Diagnostics;
|
|||
using InnovEnergy.App.Backend.Database;
|
||||
using InnovEnergy.App.Backend.Relations;
|
||||
using InnovEnergy.Lib.Utils;
|
||||
using Org.BouncyCastle.Asn1.X509;
|
||||
|
||||
namespace InnovEnergy.App.Backend.DataTypes.Methods;
|
||||
|
||||
|
@ -67,8 +68,9 @@ public static class SessionMethods
|
|||
.Apply(Db.Update);
|
||||
}
|
||||
|
||||
public static async Task<Boolean> RunScriptInBackground(this Session? session, String vpnIp, Int64 batteryNode)
|
||||
public static async Task RunScriptInBackground(this Session? session, String vpnIp, Int64 batteryNode)
|
||||
{
|
||||
Console.WriteLine("11111111111111111111111111111111111111111111111111111111111111");
|
||||
string scriptPath = "/home/ubuntu/backend/uploadBatteryFw/update_firmware.sh";
|
||||
|
||||
await Task.Run(() =>
|
||||
|
@ -80,11 +82,11 @@ public static class SessionMethods
|
|||
process.StartInfo.RedirectStandardOutput = true;
|
||||
|
||||
process.Start();
|
||||
string output = process.StandardOutput.ReadToEnd();
|
||||
process.WaitForExit(); // This can be removed if you don't need to wait for the process to finish
|
||||
Console.WriteLine(output);
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
Console.WriteLine("222222222222222222222222222222222222222222222222222222222222222");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue