updates to init-recordings-bigbluebutton make ssh port variable

This commit is contained in:
jfederico
2021-11-26 09:32:12 -05:00
parent 4d9dc1aded
commit 4a77c08b13

View File

@@ -7,17 +7,23 @@ Script for integrating BigBlueButton Recordings with Scaleite.
USAGE:
wget -qO- https://raw.githubusercontent.com/jfederico/scalelite-run/master/init-recordings-bigbluebutton.sh | bash -s -- [OPTIONS]
OPTIONS
-s <scalelite-hostname> Configure server with <scalelite-hostname> (required)
-h <scalelite-hostname> Configure server with <scalelite-hostname> (required)
-u <scalelite-username> Scalelite username <scalelite-username> (optional)
-p <scalelite-ssh-port> SSH port in Scalelite server <scalelite-ssh-port> (optional)
-r <scalelite-ssh-port> File wiht id_rsa private key to be used to ssh into Scalelite server <scalelite-id_rsa> (optional)
EXAMPLES:
Sample options for setup a BigBlueButton server
-s scalelite.example.com
-s scalelite.example.com -u scalelite
-s scalelite.example.com -u scalelite -p 2222
-s scalelite.example.com -u scalelite -p 2222 -r id_rsa-example
HERE
exit 0
}
main() {
export DEBIAN_FRONTEND=noninteractive
while builtin getopts "s:" opt "${@}"; do
while builtin getopts "s:u:p" opt "${@}"; do
case $opt in
s)
@@ -26,6 +32,16 @@ main() {
err "You must specify a valid hostname (not the hostname given in the docs)."
fi
;;
u)
USER=$OPTARG
;;
p)
PORT=$OPTARG
;;
r)
ID_RSA=$OPTARG
;;
esac
done
@@ -107,9 +123,9 @@ if [ -f "/home/bigbluebutton/.ssh/config" ]; then
fi
echo "Host scalelite-spool" | sudo tee -a /home/bigbluebutton/.ssh/config
echo " HostName $HOST" | sudo tee -a /home/bigbluebutton/.ssh/config
echo " User bigbluebutton" | sudo tee -a /home/bigbluebutton/.ssh/config
echo " Port 22" | sudo tee -a /home/bigbluebutton/.ssh/config
echo " IdentityFile /home/bigbluebutton/.ssh/id_rsa" | sudo tee -a /home/bigbluebutton/.ssh/config
echo " User ${USER:-bigbluebutton}" | sudo tee -a /home/bigbluebutton/.ssh/config
echo " Port ${PORT:-22}" | sudo tee -a /home/bigbluebutton/.ssh/config
echo " IdentityFile /home/bigbluebutton/.ssh/${ID_RSA:-id_rsa}" | sudo tee -a /home/bigbluebutton/.ssh/config
chown bigbluebutton.bigbluebutton /home/bigbluebutton/.ssh/config
echo 'Add recording transfer scripts...'
@@ -129,7 +145,7 @@ fi
wget https://raw.githubusercontent.com/blindsidenetworks/scalelite/master/bigbluebutton/scalelite.yml -P $CORE_SCRIPTS_DIR
sed -e '/spool_dir/ s/^#*/#/' -i $CORE_SCRIPTS_DIR/scalelite.yml
sed -e '/extra_rsync_opts/ s/^#*/#/' -i $CORE_SCRIPTS_DIR/scalelite.yml
echo 'spool_dir: bigbluebutton@scalelite-spool:/var/bigbluebutton/spool' | tee -a $CORE_SCRIPTS_DIR/scalelite.yml
echo 'spool_dir: scalelite-spool:/var/bigbluebutton/spool' | tee -a $CORE_SCRIPTS_DIR/scalelite.yml
echo 'extra_rsync_opts: ["-av", "--no-owner", "--chmod=F664"]' | tee -a $CORE_SCRIPTS_DIR/scalelite.yml
public_key=$(cat /home/bigbluebutton/.ssh/id_rsa.pub)