Fix serial parameter

This commit is contained in:
Gutemberg Ribeiro 2021-04-27 12:45:37 -03:00
parent 92d9754c73
commit 174789e130

View File

@ -118,10 +118,9 @@ rootCommand.Handler = CommandHandler
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;
}
@ -130,6 +129,10 @@ rootCommand.Handler = CommandHandler
ram.SetGponId(vendor);
ram.SetGponSerialNumber(serial);
}
else if (string.IsNullOrWhiteSpace(vendor) && !string.IsNullOrWhiteSpace(serial))
{
ram.SetGponSerialNumber(serial);
}
if (!string.IsNullOrWhiteSpace(mac))
{