Completed script for initialising bigbluiebutton (#5)

* scalelite host can be set up with paramaters

* updated script for bbb

* updated script for bbb

* completed script for initializing bigbluebutton
This commit is contained in:
Jesus Federico
2020-11-28 14:29:28 -05:00
committed by GitHub
parent 9d1edbb39b
commit fb3d5f871c

View File

@@ -12,11 +12,12 @@ EXAMPLES:
Sample options for setup a BigBlueButton server
-s scalelite.example.com
HERE
exit 0
}
main() {
export DEBIAN_FRONTEND=noninteractive
while builtin getopts "s" opt "${@}"; do
while builtin getopts "s:" opt "${@}"; do
case $opt in
s)
@@ -26,16 +27,40 @@ main() {
fi
;;
esac
done
if [ ! -z "$HOST" ]; then
check_host $HOST
fi
done
if [ ! -z "$HOST" ]; then
check_host $HOST
else
usage
fi
}
check_host() {
if [ ! -z "$HOST" ]; then
need_pkg dnsutils apt-transport-https net-tools
DIG_IP=$(dig +short $1 | grep '^[.0-9]*$' | tail -n1)
if [ -z "$DIG_IP" ]; then err "Unable to resolve $1 to an IP address using DNS lookup."; fi
fi
}
err() {
echo "$1" >&2
exit 1
}
main "$@" || exit 1
# We can proceed with the setup
echo 'Create a new group with GID 2000...'
groupadd -g 2000 scalelite-spool
if grep -q scalelite-spool /etc/group
then
echo "Group <scalelite-spool> exists"
else
echo "Group <scalelite-spool> does not exist. Create it with GID 2000..."
groupadd -g 2000 scalelite-spool
fi
echo 'Add the bigbluebutton user to the group...'
usermod -a -G scalelite-spool bigbluebutton
@@ -46,24 +71,22 @@ wget -O post_publish_scalelite.rb https://raw.githubusercontent.com/blindsidenet
echo 'Add recording transfer settings...'
cd /usr/local/bigbluebutton/core/scripts
wget https://raw.githubusercontent.com/blindsidenetworks/scalelite/master/bigbluebutton/scalelite.yml
echo "spool_dir: bigbluebutton@$URL_HOST:/var/bigbluebutton/spool" | tee -a /usr/local/bigbluebutton/core/scripts
echo "spool_dir: bigbluebutton@$HOST:/var/bigbluebutton/spool" | tee -a /usr/local/bigbluebutton/core/scripts/scalelite.yml
echo 'Generate ssh key pair...'
mkdir /home/bigbluebutton
chown bigbluebutton.bigbluebutton /home/bigbluebutton/
if [ -z "/home/bigbluebutton" ]; then
mkdir /home/bigbluebutton
chown bigbluebutton.bigbluebutton /home/bigbluebutton/
fi
su - bigbluebutton -s /bin/bash -c "ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_rsa"
echo 'Add this key to /home/bigbluebutton/.ssh/authorized_keys in scalelite:'
cat /home/bigbluebutton/.ssh/scalelite.pub
echo 'done'
check_host() {
if [ [ -z "$HOST" ] then
need_pkg dnsutils apt-transport-https net-tools
DIG_IP=$(dig +short $1 | grep '^[.0-9]*$' | tail -n1)
if [ -z "$DIG_IP" ]; then err "Unable to resolve $1 to an IP address using DNS lookup."; fi
get_IP $1
if [ "$DIG_IP" != "$IP" ]; then err "DNS lookup for $1 resolved to $DIG_IP but didn't match local $IP."; fi
fi
}
public_key=$(cat my_file)
set +x
echo
echo
echo "Add this key to /home/bigbluebutton/.ssh/authorized_keys in scalelite:"
echo
echo "$public_key"
echo
echo
exit 0