-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (31 loc) · 740 Bytes
/
main.py
File metadata and controls
31 lines (31 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import sys
import time
FILE_PATH = '/lib/ble/isrunning'
doNothing = False
x = os.dupterm(None, 0)
if(x == None):
import ble.blerepl
else:
os.dupterm(x,0)
try:
with open(FILE_PATH, 'r+b') as file:
byte = file.read(1)
if byte == b'\x01':
file.seek(0)
file.write(b'\x00')
doNothing = True
if(not doNothing):
with open('/web_server.py', mode='r') as exfile:
code = exfile.read()
execCode = compile(code, 'web_server.py', 'exec')
exec(execCode)
except Exception as e:
import sys
sys.print_exception(e)
finally:
import gc
gc.collect()
if 'XRPLib.resetbot' in sys.modules:
del sys.modules['XRPLib.resetbot']
import XRPLib.resetbot