From cc9f2818b4e4e7451d81500f246ecb56fb4f3f32 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Tue, 22 Nov 2022 23:21:34 +0100 Subject: [PATCH] Add exec_cmd.py --- root_overlay/bin/exec_cmd.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 root_overlay/bin/exec_cmd.py diff --git a/root_overlay/bin/exec_cmd.py b/root_overlay/bin/exec_cmd.py new file mode 100644 index 0000000..454c3c5 --- /dev/null +++ b/root_overlay/bin/exec_cmd.py @@ -0,0 +1,13 @@ +#!/usr/bin/python +import socket +import sys +sock = socket.socket(socket.AF_UNIX) +sock.connect("/tmp/nfc.sock") +sock.settimeout(1) + +for cmd in sys.argv[1:]: + sock.send(cmd.encode('utf-8') + b'\n') + try: + print(sock.recv(1024)) + except socket.timeout: + continue