DoorPi/root_overlay/bin/exec_cmd.py
2022-11-22 23:21:34 +01:00

14 lines
261 B
Python

#!/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