2022-11-11 06:43:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
WAYVNCCTL=${WAYVNCCTL:-wayvncctl}
|
|
|
|
|
|
|
|
connection_count_now() {
|
|
|
|
echo "Total clients: $count"
|
|
|
|
}
|
|
|
|
|
|
|
|
while IFS= read -r EVT; do
|
|
|
|
case "$(jq -r '.method' <<<"$EVT")" in
|
|
|
|
client-*onnected)
|
|
|
|
count=$(jq -r '.params.connection_count' <<<"$EVT")
|
|
|
|
connection_count_now "$count"
|
|
|
|
;;
|
|
|
|
esac
|
2022-11-16 00:57:16 +00:00
|
|
|
done < <("$WAYVNCCTL" --wait --reconnect --json event-receive)
|