From 69ffffc7a4846b7327ef46ada11a79c4331151ef Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 7 Sep 2018 00:56:29 +0200 Subject: [PATCH] fix some stuff --- src/fenrirscreenreader/core/remoteManager.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/fenrirscreenreader/core/remoteManager.py b/src/fenrirscreenreader/core/remoteManager.py index 414b3eab..c06aae69 100644 --- a/src/fenrirscreenreader/core/remoteManager.py +++ b/src/fenrirscreenreader/core/remoteManager.py @@ -39,8 +39,7 @@ class remoteManager(): pass def initialize(self, environment): self.env = environment - self.env['runtime']['processManager'].addCustomEventThread(self.unixSocketWatchDog, multiprocess=True) - return + if self.env['runtime']['settingsManager'].getSettingAsBool('remote', 'enabled'): if self.env['runtime']['settingsManager'].getSetting('remote', 'method') == 'unix': self.env['runtime']['processManager'].addCustomEventThread(self.unixSocketWatchDog, multiprocess=True) @@ -51,7 +50,7 @@ class remoteManager(): self.sock.close() self.sock = None def unixSocketWatchDog(self, active, eventQueue): - # echo "#<=>#command##exec#say##this is a test" | socat - UNIX-CLIENT:/tmp/fenrir-deamon.sock + # echo "command say this is a test" | socat - UNIX-CLIENT:/tmp/fenrir-deamon.sock # socket daemon # /run/user//fenrirscreenreader/daemon # socket pty @@ -59,7 +58,7 @@ class remoteManager(): socketpath = '/tmp/fenrir-deamon.sock' if os.path.exists(socketpath): os.remove(socketpath) - self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sock.bind(socketpath) self.sock.listen(1) while active.value == 1: @@ -84,7 +83,7 @@ class remoteManager(): self.sock.close() self.sock = None def tcpWatchDog(self, active, eventQueue): - # echo "#<=>#command##exec#say##this is a test" | nc localhost 22447 + # echo "command say this is a test" | nc localhost 22447 # port should be configureable self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)