mirror of
https://github.com/srlabs/blue-merle.git
synced 2024-12-22 05:44:59 -05:00
python: Added a --generate-only flag to not set the IMEI
We can probably set the IMEI through the gl_modem command. Currently, the Web interface times out when calling random-imei. I want to separate the steps so that each step does not take as long.
This commit is contained in:
parent
53bf156fd0
commit
11a8afd0a9
@ -17,6 +17,8 @@ class Modes(Enum):
|
|||||||
ap = argparse.ArgumentParser()
|
ap = argparse.ArgumentParser()
|
||||||
ap.add_argument("-v", "--verbose", help="Enables verbose output",
|
ap.add_argument("-v", "--verbose", help="Enables verbose output",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
|
ap.add_argument("-g", "--generate-only", help="Only generates an IMEI rather than setting it",
|
||||||
|
action="store_true")
|
||||||
modes = ap.add_mutually_exclusive_group()
|
modes = ap.add_mutually_exclusive_group()
|
||||||
modes.add_argument("-d", "--deterministic", help="Switches IMEI generation to deterministic mode", action="store_true")
|
modes.add_argument("-d", "--deterministic", help="Switches IMEI generation to deterministic mode", action="store_true")
|
||||||
modes.add_argument("-s", "--static", help="Sets user-defined IMEI",
|
modes.add_argument("-s", "--static", help="Sets user-defined IMEI",
|
||||||
@ -201,7 +203,8 @@ if __name__ == '__main__':
|
|||||||
imei = generate_imei(imei_prefix, imsi_d)
|
imei = generate_imei(imei_prefix, imsi_d)
|
||||||
if (verbose):
|
if (verbose):
|
||||||
print(f"Generated new IMEI: {imei}")
|
print(f"Generated new IMEI: {imei}")
|
||||||
if not set_imei(imei):
|
if not args.generate_only:
|
||||||
exit(-1)
|
if not set_imei(imei):
|
||||||
|
exit(-1)
|
||||||
|
|
||||||
exit(0)
|
exit(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user