Merge pull request #9042 from basisbit/patch-2
add missing bbb-restart-kms script which was added to 2.2.3 but is missing in the repo
This commit is contained in:
commit
9b5263e8ce
35
bigbluebutton-config/cron.hourly/bbb-restart-kms
Normal file
35
bigbluebutton-config/cron.hourly/bbb-restart-kms
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Restart Kurento every 24+ hours
|
||||
#
|
||||
|
||||
if [ ! -f /var/tmp/bbb-kms-last-restart.txt ]; then
|
||||
date +%Y-%m-%d\ %H:%M:%S > /var/tmp/bbb-kms-last-restart.txt
|
||||
exit
|
||||
fi
|
||||
|
||||
users=$(mongo --quiet mongodb://127.0.1.1:27017/meteor --eval "db.users.count({connectionStatus: 'online'})")
|
||||
|
||||
if [ "$users" -eq 0 ]; then
|
||||
|
||||
# Make sure 24 hours have passed since last restart
|
||||
|
||||
# Seconds since epoch for last restart
|
||||
dt1=$(cat /var/tmp/bbb-kms-last-restart.txt)
|
||||
t1=`date --date="$dt1" +%s`
|
||||
|
||||
# Current seconds since epoch
|
||||
dt2=`date +%Y-%m-%d\ %H:%M:%S`
|
||||
t2=`date --date="$dt2" +%s`
|
||||
|
||||
# Hours since last restart
|
||||
let "tDiff=$t2-$t1"
|
||||
let "hDiff=$tDiff/3600"
|
||||
|
||||
if [ "$hDiff" -ge 24 ]; then
|
||||
systemctl restart kurento-media-server bbb-webrtc-sfu
|
||||
date +%Y-%m-%d\ %H:%M:%S > /var/tmp/bbb-kms-last-restart.txt
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user