You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
552 B

import sys
import socket
SOCK = "/tmp/ctrl_feat.sock"
def send(cmd: str):
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as s:
s.connect(SOCK)
s.sendall((cmd.rstrip() + "\n").encode())
while True:
data = s.recv(4096)
if not data:
break
sys.stdout.write(data.decode(errors="ignore"))
if __name__ == "__main__":
cmd = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else "STATUS"
try:
send(cmd)
except Exception as e:
print(f"ERR: {e}")