From 1abd2592e1ccdc97f96ee38879ba4c0c7047304b Mon Sep 17 00:00:00 2001 From: Blallo Date: Sat, 23 Mar 2019 19:09:19 +0100 Subject: [PATCH] Improved rec-server script. --- circolog-resources/rec-server.sh | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/circolog-resources/rec-server.sh b/circolog-resources/rec-server.sh index 494bf1e..adaac88 100755 --- a/circolog-resources/rec-server.sh +++ b/circolog-resources/rec-server.sh @@ -19,6 +19,20 @@ digit_command() { tmux send-keys -t "${WINDOW}.${1}" Enter } +digit_comment() { + local input=$2 + for (( i=0; i<${#input}; i++ )) + do + sleep 0.1 + tmux send-keys -t "${WINDOW}.${1}" "${input:$i:1}" + done + sleep 2 + for (( i=0; i<${#input}; i++ )) + do + tmux send-keys -t "${WINDOW}.${1}" "C-h" + done +} + config() { tmux new -s $SESSION -n $DAEMON -d tmux set-option -t $SESSION status off @@ -33,18 +47,26 @@ config() { start_circologd() { sleep 3; - #send_command 1 "docker run --name clogd -h my-server -ti testcircolog" + digit_comment 0 "Let's start circologd in foreground. It can be put in background as an ordinary unix process and will keep on listening." digit_command 0 "circologd" } start_ctl() { - sleep 5; - # send_command 0 "docker exec clogd /go/bin/circologctl status" + sleep 20; + digit_comment 1 "Let's also play with the control utility for circologd, circologctl." + sleep 1 digit_command 1 "circologctl status" - sleep 5; + sleep 3 + digit_comment 1 "circologd can be paused..." digit_command 1 "circologctl pause" - sleep 5; + sleep 3; + digit_comment 1 "...and unpaused" digit_command 1 "circologctl pause" + sleep 3 + digit_comment 1 "A filter can be applied, so that circologd record only some messages." + digit_command 1 "circologctl filter 'msg LIKE \"%interested%\"'" + sleep 1 + digit_command 1 "circologctl status" } attach_session() {