Improved rec-server script.

This commit is contained in:
Blallo 2019-03-23 19:09:19 +01:00
parent cd56ce3725
commit 1abd2592e1
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F

View file

@ -19,6 +19,20 @@ digit_command() {
tmux send-keys -t "${WINDOW}.${1}" Enter 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() { config() {
tmux new -s $SESSION -n $DAEMON -d tmux new -s $SESSION -n $DAEMON -d
tmux set-option -t $SESSION status off tmux set-option -t $SESSION status off
@ -33,18 +47,26 @@ config() {
start_circologd() { start_circologd() {
sleep 3; 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" digit_command 0 "circologd"
} }
start_ctl() { start_ctl() {
sleep 5; sleep 20;
# send_command 0 "docker exec clogd /go/bin/circologctl status" digit_comment 1 "Let's also play with the control utility for circologd, circologctl."
sleep 1
digit_command 1 "circologctl status" digit_command 1 "circologctl status"
sleep 5; sleep 3
digit_comment 1 "circologd can be paused..."
digit_command 1 "circologctl pause" digit_command 1 "circologctl pause"
sleep 5; sleep 3;
digit_comment 1 "...and unpaused"
digit_command 1 "circologctl pause" 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() { attach_session() {