diff --git a/NeoBoot/files/tools.py b/NeoBoot/files/tools.py index 8c10e73..5668861 100644 --- a/NeoBoot/files/tools.py +++ b/NeoBoot/files/tools.py @@ -971,11 +971,12 @@ class MyUpgrade2(Screen): self.activityTimer.start(10) def updateInfo(self): - os.system('mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local') + if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh'): + os.system('mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local') periodo = '/usr/lib/periodon' testinout = '/usr/lib/enigma2/python/Tools/Testinout.p*' zerotier = '/var/lib/zerotier-one/identity.secret' - S99neo = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local' + S99neo = '/etc/rcS.d/S99neo.local' self.activityTimer.stop() f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') mypath2 = f2.readline().strip() @@ -991,7 +992,10 @@ class MyUpgrade2(Screen): target1 = dirfile + '/usr/lib/' target2 = dirfile + '/usr/lib/enigma2/python/Tools/' target3 = dirfile + '/var/lib/zerotier-one/' - target4 = dirfile + '/etc/rcS.d/' + target4 = dirfile + '/etc/rcS.d/S99neo.local' + target5 = dirfile + '/etc/init.d/rcS.local' + target6 = dirfile + '/etc/init.d/rc.local' + cmd = 'rm -r ' + target + ' > /dev/null 2>&1' system(cmd) cmd = 'cp -af ' + LinkNeoBoot + ' ' + target @@ -1001,12 +1005,22 @@ class MyUpgrade2(Screen): cmd2 = 'cp -af ' + testinout + ' ' + target2 system(cmd2) #cmd3 - if fileExists('%sImageBoot/%s/var/lib/zerotier-one/' % (getNeoLocation(), getImageNeoBoot())): + if fileExists('%s' % target3): if fileExists('/var/lib/zerotier-one/identity.secret'): cmd = 'cp -aRf ' + zerotier + ' ' + target3 system(cmd) - cmd4 = 'cp -af ' + S99neo + ' ' + target4 + + cmd4 = 'cp -aRf ' + S99neo + ' ' + target4 system(cmd4) + + if fileExists('%s' % target5): + cmd5 = 'rm -r ' + target5 + ' > /dev/null 2>&1' + system(cmd5) + if fileExists('%s' % target6): + cmd6 = 'rm -r ' + target6 + ' > /dev/null 2>&1' + system(cmd6) + + #multiboot_vu+ if fileExists('/linuxrootfs1'): cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs1' + LinkNeoBoot + ' ' system(cmd) @@ -1018,14 +1032,15 @@ class MyUpgrade2(Screen): system(cmd) if fileExists('/linuxrootfs4'): cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs4' + LinkNeoBoot + ' ' - system(cmd) + system(cmd) out = open('%sImageBoot/.version' % getNeoLocation(), 'w') out.write(PLUGINVERSION) out.close() - os.system('mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh') + if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local'): + os.system('mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh') self.myClose(_('NeoBoot successfully updated. You can restart the plugin now.\nHave fun !!')) - + def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) self.close()