option to run unpriviledged, more detailed intro

This commit is contained in:
apoc 2021-02-17 01:05:31 +01:00
parent 5a4c37a624
commit 7d9692bce1
Signed by: apoc
GPG Key ID: FB5C4A681CCD5FB2

View File

@ -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" == "" ]]