From b0db3b39e4f97db593c816ae1532b120e4773720 Mon Sep 17 00:00:00 2001 From: gutosie Date: Sun, 27 Nov 2022 21:13:09 +0200 Subject: [PATCH] Update stbbranding.py --- NeoBoot/files/stbbranding.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/NeoBoot/files/stbbranding.py b/NeoBoot/files/stbbranding.py index 306da18..bc65f9e 100644 --- a/NeoBoot/files/stbbranding.py +++ b/NeoBoot/files/stbbranding.py @@ -977,25 +977,27 @@ def getMountPointNeo2(): os.system('echo "\n\nexit 0" >> ' + LinkNeoBoot + '/files/mountpoint.sh') def getBoxMacAddres(): - os.system('%s > /tmp/.mymac' % ("ifconfig -a")) - if fileExists('/etc/.nameneo'): - os.system('cp -r /etc/.nameneo /tmp/.mymac; sleep 1') - with open('/tmp/.mymac', 'r') as f: - myboxmac = f.read() + ethernetmac = 'UNKNOWN' + if not fileExists('/etc/.nameneo'): + os.system('%s > /tmp/.mymac' % ("ifconfig -a")) + if os.path.exists('/etc/.nameneo'): + with open('/etc/.nameneo', 'r') as f: + ethernetmac = f.readline().strip() f.close() - EthernetMac = myboxmac + os.system('cp -r /etc/.nameneo /tmp/.mymac') + #return ethernetmac + elif fileExists('/tmp/.mymac'): f = open("/tmp/.mymac", 'r') myboxmac = f.readline().strip().replace("eth0 Link encap:Ethernet HWaddr ", "") f.close() - EthernetMac = myboxmac + ethernetmac = myboxmac writefile = open('/tmp/.mymac' , 'w') writefile.write(myboxmac) writefile.close() elif not fileExists('/tmp/.mymac'): - EthernetMac = '12:34:56:78:91:02' - - return EthernetMac + ethernetmac = '12:34:56:78:91:02' + return ethernetmac def getCheckActivateVip(): supportedvip = ''