# -*- coding: utf-8 -*- import os import lliurex.net class WolEnabler: LOG=False def startup(self,options): if options["boot"]: self.enable_wol() #def startup def enable_wol(self): t=threading.Thread(target=self._enable_wol) t.daemon=True t.start() #def enable_wol def _enable_wol(self): devices=lliurex.net.get_devices_info() if WolEnabler.LOG: f=open("/tmp/WolEnabler.log","w") for dev in devices: if WolEnabler.LOG: f.write("%s, %s\n"%(dev["name"],command)) command="ethtool -s %s wol g 1>/dev/null 2>/dev/null"%dev["name"] os.system(command) if WolEnabler.LOG: f.close() #def _enable_wol #class WolEnabler