ILIAS-7-Install-Tutorial for Ubuntu 20.04

Check the turnserver

Restart the turnserver if its unreachable

  • nano /etc/crontab
  • */1 *   * * *   root    /opt/scripts/checkturn > /dev/null 2>&1
  • mkdir -p /opt/scripts
  • nano /opt/scripts/checkturn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
secret="123"
url="turn.bbs-ilias.de"
logpath=/opt/scripts/checkturn.log

string="0: socket_connect: cannot connect to remote addr: 111"
status=""

status=$(turnutils_uclient -T -W ${secret} ${url})
#echo $status

if [[ $status == *${string}* ]];
then

echo "Turn-Server seems to be down"

for ((i=1;i<=3;i++));

do
echo "Loop $i"
status=$(turnutils_uclient -T -W ${secret} ${url})
echo $status
if [[ $status != *${string}* ]];
then
echo "[`date '+%d.%m.%Y %H:%M:%S'`] Turn-Server is back :)" >> $logpath
exit

else

if [[ $i -eq 3 ]];
then
echo "Turn server reboots now"
reboot
else

echo "Turn server restart"
systemctl stop coturn
systemctl start coturn
echo "sleeping for 10 seconds"
sleep 10
fi

fi

: $i;
done
else

echo "Turn-Seems to be good"
fi
  • chmod +x /opt/scripts/checkturn


No comment has been posted yet.