Skip to content

Commit 5b4482e

Browse files
authored
Merge pull request #1177 from steveseguin/steveseguin-patch-10
Update turnserver_install.sh.sample
2 parents 89ac016 + 4394583 commit 5b4482e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

turnserver_install.sh.sample

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ setup_permissions() {
2020
chmod 600 /etc/coturn/certs/*.pem
2121
}
2222

23+
wait_for_apt() {
24+
while fuser /var/lib/dpkg/lock >/dev/null 2>&1 || fuser /var/lib/apt/lists/lock >/dev/null 2>&1 || fuser /var/cache/apt/archives/lock >/dev/null 2>&1 || fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1; do
25+
echo "Waiting for other apt processes to finish..."
26+
sleep 5
27+
done
28+
}
29+
2330
configure_ssl() {
2431
local DOMAIN=$1
2532

@@ -32,6 +39,8 @@ configure_ssl() {
3239

3340
# Install certbot if needed
3441
if ! command -v certbot >/dev/null; then
42+
echo "Installing certbot..."
43+
wait_for_apt
3544
apt-get install certbot -y
3645
fi
3746

@@ -207,4 +216,4 @@ echo "STUN/TURN ports: 3478 (default)"
207216
if [ "${ENABLE_SSL,,}" = "y" ]; then
208217
echo "TLS enabled on port 443"
209218
echo "SSL certificates will automatically renew via certbot"
210-
fi
219+
fi

0 commit comments

Comments
 (0)