Added reboot support to Wallaby Control
This commit is contained in:
parent
d04a29c018
commit
6bc587c575
3 changed files with 19 additions and 36 deletions
|
@ -9,7 +9,8 @@ import sys
|
|||
|
||||
class WallabyControl(Routing.ClientRoute):
|
||||
def run(self, data, handler):
|
||||
commands = {"stop" : self.stop, "restart" : self.restart, "disconnect" : self.disconnect}
|
||||
commands = {"stop" : self.stop, "restart" : self.restart,
|
||||
"disconnect" : self.disconnect, "reboot" : self.reboot}
|
||||
if data in commands:
|
||||
commands[data](handler)
|
||||
|
||||
|
@ -21,6 +22,9 @@ class WallabyControl(Routing.ClientRoute):
|
|||
time.sleep(15)
|
||||
os.execl(sys.executable, *([sys.executable]+sys.argv))
|
||||
|
||||
def reboot(self, handler):
|
||||
os.system("reboot")
|
||||
|
||||
def disconnect(self, handler):
|
||||
handler.sock.close()
|
||||
|
||||
|
|
Reference in a new issue