coturn_sessions: Make it compatible with busybox telnet

This commit is contained in:
Sebastian L 2021-05-29 16:05:34 +02:00 committed by Lars Kruse
parent 0860ec94cb
commit e311c24d69
1 changed files with 1 additions and 4 deletions

View File

@ -39,8 +39,6 @@ cliport=${port:-5766}
clipassword=${password:-}
get_coturn_stats() {
echo "open 127.0.0.1 $cliport"
sleep 1
echo "$clipassword"
sleep 1
for i in udp tcp dtls tls
@ -100,10 +98,9 @@ case $1 in
esac
SESSIONS=$(get_coturn_stats | telnet 2> /dev/null | grep "Total sessions: " | sed 's/ Total sessions: //')
SESSIONS=$(get_coturn_stats | telnet 127.0.0.1 "$cliport" 2> /dev/null | grep "Total sessions: " | sed 's/ Total sessions: //')
echo "udp_sessions.value $(pick_line "$SESSIONS" 1)"
echo "tcp_sessions.value $(pick_line "$SESSIONS" 2)"
echo "dtls_sessions.value $(pick_line "$SESSIONS" 3)"
echo "tls_sessions.value $(pick_line "$SESSIONS" 4)"