Add exec_cmd.py

This commit is contained in:
Lynn Ochs 2022-11-22 23:21:34 +01:00
parent e8255b90e5
commit cc9f2818b4

View File

@ -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