repo: veilid-hacks
action: blob
revision: 
path_from: veilid-getstate
revision_from: refs/heads/trunk:
path_to: 
revision_to: 
git.thebackupbox.net
veilid-hacks
git clone git://git.thebackupbox.net/veilid-hacks

blob of:

veilid-hacks

/ veilid-getstate

blob_plain of this file

refs/heads/trunk:/veilid-getstate

 #!/usr/bin/env bash

 if [ "$1" = "-h" -o "$1" = "--help" ];then
   printf 'usage: veilid-now\n' >&2
   exit 1
 fi

 if [ "$1" != "socat" ];then
   exec socat tcp:"${VEILID_SERVER:-127.0.0.1:5959}" exec:"$0 socat" 2>&1
 else
   shift
 fi

 printf '{"op":"GetState"}\n'
 state=0
 stdbuf -oL jq -nc 'inputs | select(.type != "Update")' | while read -r line;do
   jq -r .value <<< "$line" >&2
       printf '\nQUIT :what? this isnt woodshop?\r\n'
 done