blob: 2c01e309113d303038d9e13371f59792536ec598 (
plain) (
blame)
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
|
#!/bin/sh
: ${coturn_secret:="$turn_secret"}
: ${coturn_external_ip:="$BOXCONF_DEFAULT_IPV4"}
: ${coturn_realm:="$turn_domain"}
: ${coturn_threads:="$nproc"}
coturn_user=coturn
coturn_uid=792
add_user \
-u "$coturn_uid" \
-c 'Turnserver Psuedo-User' \
-d /nonexistent \
-s /usr/sbin/nologin \
"$coturn_user"
# Install required packages.
pkg install -y turnserver
# Copy coturn config file.
install_template -o root -g "$coturn_user" -m 0640 /usr/local/etc/turnserver.conf
# Start turnserver.
sysrc -v \
turnserver_enable=YES \
turnserver_user="$coturn_user" \
turnserver_group="$coturn_user"
service turnserver restart
|