Skip to content

Commit

Permalink
Merge pull request #4 from Unifi-Tools/fix-serial
Browse files Browse the repository at this point in the history
Allow --serial without --vendor
  • Loading branch information
galvesribeiro authored Apr 27, 2021
2 parents 92d9754 + 174789e commit 640627f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/UFiber.Configurator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ ScpClient GetSCPClient(string userName, string password, string host, int port =
Console.WriteLine($"### Patching {imgName}...");
if ((string.IsNullOrWhiteSpace(vendor) && !string.IsNullOrWhiteSpace(serial)) ||
(!string.IsNullOrWhiteSpace(vendor) && string.IsNullOrWhiteSpace(serial)))
if (!string.IsNullOrWhiteSpace(vendor) && string.IsNullOrWhiteSpace(serial))
{
Console.Error.WriteLine($"To set the GPON Serial Number, you must pass both --vendor and --serial");
Console.Error.WriteLine($"To set the GPON Serial Number, you must pass both --vendor and --serial. You can skip the --vendor if you provide the full serial as HEX to the --serial.");
Environment.ExitCode = -1;
return;
}
Expand All @@ -130,6 +129,10 @@ ScpClient GetSCPClient(string userName, string password, string host, int port =
ram.SetGponId(vendor);
ram.SetGponSerialNumber(serial);
}
else if (string.IsNullOrWhiteSpace(vendor) && !string.IsNullOrWhiteSpace(serial))
{
ram.SetGponSerialNumber(serial);
}
if (!string.IsNullOrWhiteSpace(mac))
{
Expand Down

0 comments on commit 640627f

Please sign in to comment.