From 7d9692bce17d1e4182edfe5f6d657ef90121b2c6 Mon Sep 17 00:00:00 2001 From: apoc Date: Wed, 17 Feb 2021 01:05:31 +0100 Subject: [PATCH] option to run unpriviledged, more detailed intro --- chaospott_bbb.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/chaospott_bbb.sh b/chaospott_bbb.sh index 05ac5b3..0285347 100644 --- a/chaospott_bbb.sh +++ b/chaospott_bbb.sh @@ -1,10 +1,20 @@ #!/bin/bash -# SETUP: apt-get install libxml2-utils wget -# cronjob: +# SETUP: +# apt-get install libxml2-utils wget +# fill in APIEndPoint and Secret from bbb-conf --secret, or run as root +# set up cronjob: # */1 * * * * status=`/path/to/chaospott_bbb.sh` && [ "$status" ] && echo $status > /path/to/htdocs/chaospott_bbb.json +# make JSON file available, e.g. in /var/www/bigbluebutton-default/ # +# should output something like +# {"active": true, "participantCount": 1, "startTime": 1613519724738} +# if room is active, or +# {"active": false, "participantCount": 0, "startTime": 0} +# if room is inactive ROOM="Chaospott" +APIEndPoint="" +SECRET="" [ -z `which xmllint` ] && exit 1 if which wget >/dev/null; then @@ -15,13 +25,18 @@ else exit 1; fi +if [ -z "$APIEndPoint" ]; then + X=$( bbb-conf --secret | fgrep URL: ) + APIEndPoint=${X##* } +fi +if [ -z "$Secret" ]; then + Y=$( bbb-conf --secret | fgrep Secret: ) + Secret=${Y##* } +fi + APICallName="getMeetings" APIQueryString="" -X=$( bbb-conf --secret | fgrep URL: ) -APIEndPoint=${X##* } -Y=$( bbb-conf --secret | fgrep Secret: ) -Secret=${Y##* } S=$APICallName$APIQueryString$Secret Checksum=$( echo -n $S | sha1sum | cut -f 1 -d ' ' ) if [[ "$APIQueryString" == "" ]]