New server.cast and magic script to produce it.
This commit is contained in:
parent
29b319e2f3
commit
0e7d74a3cc
2 changed files with 146 additions and 5 deletions
63
circolog-resources/rec-server.sh
Executable file
63
circolog-resources/rec-server.sh
Executable file
|
@ -0,0 +1,63 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SESSION="circolog"
|
||||||
|
DAEMON="d"
|
||||||
|
WINDOW="${SESSION}:${DAEMON}"
|
||||||
|
|
||||||
|
send_command() {
|
||||||
|
tmux send-keys -t "${WINDOW}.${1}" "${2}" Enter
|
||||||
|
}
|
||||||
|
|
||||||
|
digit_command() {
|
||||||
|
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
|
||||||
|
tmux send-keys -t "${WINDOW}.${1}" Enter
|
||||||
|
}
|
||||||
|
|
||||||
|
config() {
|
||||||
|
tmux new -s $SESSION -n $DAEMON -d
|
||||||
|
tmux set-option -t $SESSION status off
|
||||||
|
tmux split-window -v -t $WINDOW
|
||||||
|
send_command 0 "bash"
|
||||||
|
send_command 1 "bash"
|
||||||
|
send_command 0 "PS1='my-server ~ '"
|
||||||
|
send_command 1 "PS1='my-server ~ '"
|
||||||
|
send_command 0 "clear"
|
||||||
|
send_command 1 "clear"
|
||||||
|
}
|
||||||
|
|
||||||
|
start_circologd() {
|
||||||
|
sleep 3;
|
||||||
|
#send_command 1 "docker run --name clogd -h my-server -ti testcircolog"
|
||||||
|
digit_command 0 "circologd"
|
||||||
|
}
|
||||||
|
|
||||||
|
start_ctl() {
|
||||||
|
sleep 5;
|
||||||
|
# send_command 0 "docker exec clogd /go/bin/circologctl status"
|
||||||
|
digit_command 1 "circologctl status"
|
||||||
|
sleep 5;
|
||||||
|
digit_command 1 "circologctl pause"
|
||||||
|
sleep 5;
|
||||||
|
digit_command 1 "circologctl pause"
|
||||||
|
}
|
||||||
|
|
||||||
|
attach_session() {
|
||||||
|
tmux attach -t $SESSION
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
send_command 0 "C-c"
|
||||||
|
tmux kill-session -t $SESSION
|
||||||
|
}
|
||||||
|
|
||||||
|
trap cleanup 2 15
|
||||||
|
config
|
||||||
|
start_circologd &
|
||||||
|
start_ctl &
|
||||||
|
attach_session
|
|
@ -1,5 +1,83 @@
|
||||||
{"version": 2, "width": 86, "height": 29, "timestamp": 1553199871, "env": {"SHELL": "/bin/zsh", "TERM": "xterm-256color"}}
|
{"version": 2, "width": 89, "height": 29, "timestamp": 1553274045, "env": {"SHELL": "/bin/zsh", "TERM": "xterm-kitty"}}
|
||||||
[0.48397, "o", "Binding address `127.0.0.1:9514` [syslog]\r\nBinding address `127.0.0.1:9080` [http]\r\nBinding address `/tmp/circologd-ctl.sock` [http]\r\n"]
|
[0.759316, "o", "\u001b[H\u001b[Kmy-server ~ \u001b[17;1H\u001b[Kmy-server ~ "]
|
||||||
[4.384817, "o", "^C"]
|
[3.154515, "o", "\u001b[1dc\u001b[17;13H"]
|
||||||
[4.38539, "o", "2019/03/21 20:24:35 Quitting because of signal interrupt\r\n"]
|
[3.264101, "o", "\u001b[1;14Hi\u001b[17;13H"]
|
||||||
[4.3861, "o", "Error cleaning /tmp/circologd-ctl.sock : remove /tmp/circologd-ctl.sock: no such file or directory\r\n"]
|
[3.379486, "o", "\u001b[1;15Hr\u001b[17;13H"]
|
||||||
|
[3.494536, "o", "\u001b[1;16Hc\u001b[17;13H"]
|
||||||
|
[3.604033, "o", "\u001b[1;17Ho\u001b[17;13H"]
|
||||||
|
[3.719434, "o", "\u001b[1;18Hl\u001b[17;13H"]
|
||||||
|
[3.835062, "o", "\u001b[1;19Ho\u001b[17;13H"]
|
||||||
|
[3.9507, "o", "\u001b[1;20Hg\u001b[17;13H"]
|
||||||
|
[4.066193, "o", "\u001b[1;21Hd\u001b[17;13H"]
|
||||||
|
[5.154301, "o", "c"]
|
||||||
|
[5.261403, "o", "i"]
|
||||||
|
[5.375829, "o", "r"]
|
||||||
|
[5.491457, "o", "c"]
|
||||||
|
[5.606791, "o", "o"]
|
||||||
|
[5.717046, "o", "l"]
|
||||||
|
[5.822792, "o", "o"]
|
||||||
|
[5.932519, "o", "g"]
|
||||||
|
[6.047915, "o", "c"]
|
||||||
|
[6.093464, "o", "\u001b[2;1HBinding address `127.0.0.1:9514` [syslog]\r\nBinding address `127.0.0.1:9080` [http]\u001b[17;22H"]
|
||||||
|
[6.093883, "o", "\u001b[4;1HBinding address `/tmp/circologd-ctl.sock` [http]\u001b[17;22H"]
|
||||||
|
[6.184407, "o", "t"]
|
||||||
|
[6.297215, "o", "l"]
|
||||||
|
[6.412799, "o", " "]
|
||||||
|
[6.528303, "o", "s"]
|
||||||
|
[6.644253, "o", "t"]
|
||||||
|
[6.759721, "o", "a"]
|
||||||
|
[6.873708, "o", "t"]
|
||||||
|
[6.983541, "o", "u"]
|
||||||
|
[7.098914, "o", "s"]
|
||||||
|
[9.113538, "o", "\r\n"]
|
||||||
|
[9.116525, "o", "Buffer Size: 1000\r\nServer Status: unpaused\r\nFilter String: <Empty Expression>\r\n"]
|
||||||
|
[9.116994, "o", "my-server ~ \u001b[?25l\u001b[?12l\u001b[?25h"]
|
||||||
|
[14.221184, "o", "c"]
|
||||||
|
[14.331184, "o", "i"]
|
||||||
|
[14.447238, "o", "r"]
|
||||||
|
[14.562845, "o", "c"]
|
||||||
|
[14.67815, "o", "o"]
|
||||||
|
[14.792836, "o", "l"]
|
||||||
|
[14.908057, "o", "o"]
|
||||||
|
[15.023417, "o", "g"]
|
||||||
|
[15.138658, "o", "c"]
|
||||||
|
[15.254266, "o", "t"]
|
||||||
|
[15.369453, "o", "l"]
|
||||||
|
[15.484815, "o", " "]
|
||||||
|
[15.600655, "o", "p"]
|
||||||
|
[15.71595, "o", "a"]
|
||||||
|
[15.830533, "o", "u"]
|
||||||
|
[15.939423, "o", "s"]
|
||||||
|
[16.04931, "o", "e"]
|
||||||
|
[18.059555, "o", "\r\n"]
|
||||||
|
[18.062041, "o", "\u001b[5dpaused\u001b[22;1H"]
|
||||||
|
[18.062533, "o", "my-server ~ \u001b[?25l\u001b[?12l\u001b[?25h"]
|
||||||
|
[23.17183, "o", "c"]
|
||||||
|
[23.281193, "o", "i"]
|
||||||
|
[23.387051, "o", "r"]
|
||||||
|
[23.497196, "o", "c"]
|
||||||
|
[23.612584, "o", "o"]
|
||||||
|
[23.728009, "o", "l"]
|
||||||
|
[23.843879, "o", "o"]
|
||||||
|
[23.959212, "o", "g"]
|
||||||
|
[24.074962, "o", "c"]
|
||||||
|
[24.189235, "o", "t"]
|
||||||
|
[24.302282, "o", "l"]
|
||||||
|
[24.417794, "o", " "]
|
||||||
|
[24.53347, "o", "p"]
|
||||||
|
[24.645442, "o", "a"]
|
||||||
|
[24.757005, "o", "u"]
|
||||||
|
[24.870256, "o", "s"]
|
||||||
|
[24.985604, "o", "e"]
|
||||||
|
[27.000262, "o", "\r\n"]
|
||||||
|
[27.00283, "o", "\u001b[6dunpaused\u001b[23;1H"]
|
||||||
|
[27.003379, "o", "my-server ~ \u001b[?25l\u001b[?12l\u001b[?25h"]
|
||||||
|
[31.217873, "o", "exit\r\n"]
|
||||||
|
[31.21945, "o", "\u001b[1m\u001b[7m%\u001b(B\u001b[m \u001b[24;1H \r"]
|
||||||
|
[31.403621, "o", "\u001b[?2004h"]
|
||||||
|
[32.050374, "o", "\r\n\u001b[?2004l"]
|
||||||
|
[32.099303, "o", "\u001b[?25l\u001b[Hmy-server ~ circologd\u001b[K\r\nBinding address `127.0.0.1:9514` [syslog]\u001b[K\r\nBinding address `127.0.0.1:9080` [http]\u001b[K\r\nBinding address `/tmp/circologd-ctl.sock` [http] \u001b[K\r\npaused\u001b[K\r\nunpaused\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\u001b[7d\u001b[?12l\u001b[?25h"]
|
||||||
|
[32.927704, "o", "^C"]
|
||||||
|
[32.92813, "o", "2019/03/22 18:01:18 Quitting because of signal interrupt\r\n"]
|
||||||
|
[32.930563, "o", "my-server ~ \u001b[?25l\u001b[?12l\u001b[?25h"]
|
||||||
|
[33.377483, "o", "exit\r\n"]
|
||||||
|
|
Loading…
Reference in a new issue