summaryrefslogtreecommitdiff
path: root/init-recordings-scalelite.sh
diff options
context:
space:
mode:
authorjfederico <jesus@123it.ca>2021-03-20 00:59:42 -0400
committerjfederico <jesus@123it.ca>2021-03-20 00:59:42 -0400
commite62fd6284be355d922e7623d1983b58fe7b6071c (patch)
treeb48f7f0c6c0bb6aaa5dd55676be920318a23c9ed /init-recordings-scalelite.sh
parent9d07502b4e04d8276f3be1c57a0d83a9e211e34e (diff)
downloadscalelite-run-itzks-e62fd6284be355d922e7623d1983b58fe7b6071c.tar.gz
scalelite-run-itzks-e62fd6284be355d922e7623d1983b58fe7b6071c.tar.bz2
scalelite-run-itzks-e62fd6284be355d922e7623d1983b58fe7b6071c.zip
fixed script for initializing scalelite recordings
Diffstat (limited to 'init-recordings-scalelite.sh')
-rwxr-xr-xinit-recordings-scalelite.sh33
1 files changed, 22 insertions, 11 deletions
diff --git a/init-recordings-scalelite.sh b/init-recordings-scalelite.sh
index 4c74bed..2613c5c 100755
--- a/init-recordings-scalelite.sh
+++ b/init-recordings-scalelite.sh
@@ -2,25 +2,36 @@
source ./.env
SCALELITE_RECORDING_DIR=${SCALELITE_RECORDING_DIR-/mnt/scalelite-recordings/var/bigbluebutton}
-SCALELITE_RECORDING_DIR_ROOT=$(dirname $(dirname $SCALELITE_RECORDING_DIR))
echo 'Add the bigbluebutton user...'
-useradd -m -d /home/bigbluebutton -s /bin/bash bigbluebutton
-su - bigbluebutton -s /bin/bash -c 'mkdir ~/.ssh && touch ~/.ssh/authorized_keys'
+id -u bigbluebutton &>/dev/null || useradd -m -d /home/bigbluebutton -s /bin/bash bigbluebutton
+if [ ! -d "/home/bigbluebutton/.ssh" ]; then
+ su - bigbluebutton -s /bin/bash -c 'mkdir ~/.ssh && touch ~/.ssh/authorized_keys'
+fi
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 created"
+ groupadd -g 2000 scalelite-spool
+fi
echo 'Add the bigbluebutton user to the group...'
usermod -a -G scalelite-spool bigbluebutton
echo 'Create the directory structure for recording ...'
-mkdir -p $SCALELITE_RECORDING_DIR_ROOT/var/bigbluebutton/spool
-mkdir -p $SCALELITE_RECORDING_DIR_ROOT/var/bigbluebutton/recording/scalelite
-mkdir -p $SCALELITE_RECORDING_DIR_ROOT/var/bigbluebutton/published
-mkdir -p $SCALELITE_RECORDING_DIR_ROOT/var/bigbluebutton/unpublished
-chown -R 1000:2000 $SCALELITE_RECORDING_DIR_ROOT/
-chmod -R 0775 $SCALELITE_RECORDING_DIR_ROOT/
+mkdir -p $SCALELITE_RECORDING_DIR/spool
+mkdir -p $SCALELITE_RECORDING_DIR/recording/scalelite
+mkdir -p $SCALELITE_RECORDING_DIR/published
+mkdir -p $SCALELITE_RECORDING_DIR/unpublished
+chown -R 1000:2000 $SCALELITE_RECORDING_DIR
+chmod -R 0775 $SCALELITE_RECORDING_DIR
echo 'Create symbolic link to the directory structure for uploading ...'
-ln -s $SCALELITE_RECORDING_DIR_ROOT/var/bigbluebutton /var/bigbluebutton
+if [ -d "/var/bigbluebutton" ]; then
+ mv /var/bigbluebutton /var/.bigbluebutton
+elif [ -e "/var/bigbluebutton" ]; then
+ rm /var/bigbluebutton
+fi
+ln -s $SCALELITE_RECORDING_DIR /var/bigbluebutton