Add exec_cmd.py
This commit is contained in:
parent
e8255b90e5
commit
cc9f2818b4
13
root_overlay/bin/exec_cmd.py
Normal file
13
root_overlay/bin/exec_cmd.py
Normal 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
|
Loading…
Reference in New Issue
Block a user