DoorPi/root_overlay/bin/exec_cmd.py

14 lines
261 B
Python
Raw Normal View History

2022-11-22 22:21:34 +00:00
#!/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