From 203de98593b04848e9edf23cc2c70c4f8b9b7251 Mon Sep 17 00:00:00 2001 From: gutosie Date: Tue, 22 Mar 2022 21:03:40 +0200 Subject: [PATCH] Update plugin.py --- NeoBoot/plugin.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NeoBoot/plugin.py b/NeoBoot/plugin.py index 34e0445..3c8b46d 100644 --- a/NeoBoot/plugin.py +++ b/NeoBoot/plugin.py @@ -445,9 +445,16 @@ class NeoBootInstallation(Screen): def checkinstall2(self): if fileExists('/media/usb/ImageBoot/') and fileExists('/media/hdd/ImageBoot/'): + os.system('umount -l /media/usb; sleep 2') + if len(os.listdir('/media/usb') ) == 0: + #print("Directory is empty") + os.system('rm -r /media/usb ') + if fileExists('/media/hdd/ImageBoot/'): + self.checkinstall3() + elif not fileExists('/media/hdd/ImageBoot/'): + os.system('umount -l /media/hdd; sleep 2; mkdir -p /media/usb') mess = _('An error was encountered, you have neoboot installed on usb and hdd.\nUninstall one directories from one drive.') self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) - else: self.checkinstall3()