Update tools.py

This commit is contained in:
gutosie
2022-03-22 21:40:33 +02:00
committed by GitHub
parent 021eb6e33e
commit 00c273ced2

View File

@@ -2188,8 +2188,16 @@ class DiskLabelSet(Screen):
if lines.find('/dev/sdf1 /media/usb') != -1:
os.system('tune2fs -L usb /dev/sdf1')
cmd2 = "echo -e '\n\n%s '" % _('Label set OK')
with open('/etc/fstab', 'r') as f:
flines = f.read()
f.close()
if flines.find('' + getMyUUID() + '') != -1:
cmd3 = "echo -e '\n%s '" % _('UUID already exists')
else:
os.system('echo UUID=' + getMyUUID() + ' ' + locatin_neo + ' auto defaults 0 0 >> /etc/fstab')
cmd3 = "echo -e '\n\n%s '" % _('UUID set OK')
cmd3 = "echo -e '\n%s '" % _('UUID set OK')
self.session.open(Console, _('Disk Label...!'), [cmd, cmd1, cmd2,cmd3])