Fix backup mtd partition by number

This commit is contained in:
remittor
2021-11-23 14:50:50 +03:00
parent 1a94dd4766
commit 5732a4bb27
+6 -2
View File
@@ -30,8 +30,12 @@ if len(sys.argv) > 1:
print(" ")
a_part = input("Enter partition name or mtd number: ")
if a_part != 'a':
if isinstance(a_part, int):
p = a_part
try:
i_part = int(a_part)
except:
i_part = None
if i_part is not None:
p = i_part
if p < 0 or p >= len(dev.partlist):
die('Partition "mtd{}" not found!'.format(a_part))
else: