This commit is contained in:
Bob Mottram 2016-03-29 22:33:01 +01:00
parent fd7a82a460
commit 6b3c7bd278
1 changed files with 13 additions and 13 deletions

View File

@ -1070,7 +1070,7 @@ function read_configuration {
# Ensure that a copy of the config exists for upgrade purposes # Ensure that a copy of the config exists for upgrade purposes
if [[ $CONFIGURATION_FILE != "/root/${PROJECT_NAME}.cfg" ]]; then if [[ $CONFIGURATION_FILE != "/root/${PROJECT_NAME}.cfg" ]]; then
cp $CONFIGURATION_FILE /root/${PROJECT_NAME}.cfg cp $CONFIGURATION_FILE /root/${PROJECT_NAME}.cfg
fi fi
if grep -q "VOIP_TURN_PORT" $CONFIGURATION_FILE; then if grep -q "VOIP_TURN_PORT" $CONFIGURATION_FILE; then
VOIP_TURN_PORT=$(grep "VOIP_TURN_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') VOIP_TURN_PORT=$(grep "VOIP_TURN_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
@ -9601,7 +9601,7 @@ function install_mediagoblin {
if [ ! -d $MEDIAGOBLIN_WORKING_DIRECTORY ]; then if [ ! -d $MEDIAGOBLIN_WORKING_DIRECTORY ]; then
mkdir -p $MEDIAGOBLIN_WORKING_DIRECTORY mkdir -p $MEDIAGOBLIN_WORKING_DIRECTORY
fi fi
git_clone $MEDIAGOBLIN_REPO $MEDIAGOBLIN_WORKING_DIRECTORY git_clone $MEDIAGOBLIN_REPO $MEDIAGOBLIN_WORKING_DIRECTORY
cd $MEDIAGOBLIN_WORKING_DIRECTORY cd $MEDIAGOBLIN_WORKING_DIRECTORY
@ -9611,17 +9611,17 @@ function install_mediagoblin {
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
exit 278826 exit 278826
fi fi
./configure --with-python3 --without-virtualenv ./configure --with-python3 --without-virtualenv
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
exit 462826 exit 462826
fi fi
make make
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then
exit 738229 exit 738229
fi fi
if [ ! -d $MEDIAGOBLIN_WORKING_DIRECTORY/user_dev ]; then if [ ! -d $MEDIAGOBLIN_WORKING_DIRECTORY/user_dev ]; then
mkdir $MEDIAGOBLIN_WORKING_DIRECTORY/user_dev mkdir $MEDIAGOBLIN_WORKING_DIRECTORY/user_dev
fi fi
@ -9638,14 +9638,14 @@ function install_mediagoblin {
echo $'paste.ini not found' echo $'paste.ini not found'
exit 52762 exit 52762
fi fi
cp -av mediagoblin.ini mediagoblin_local.ini cp -av mediagoblin.ini mediagoblin_local.ini
cp -av paste.ini paste_local.ini cp -av paste.ini paste_local.ini
# TODO configure ini files # TODO configure ini files
chown -hR mediagoblin:www-data $MEDIAGOBLIN_WORKING_DIRECTORY chown -hR mediagoblin:www-data $MEDIAGOBLIN_WORKING_DIRECTORY
# init with systemd # init with systemd
echo '[Unit]' > /etc/systemd/system/mediagoblin.service echo '[Unit]' > /etc/systemd/system/mediagoblin.service
echo 'Description=Mediagoblin (Media Server)' >> /etc/systemd/system/mediagoblin.service echo 'Description=Mediagoblin (Media Server)' >> /etc/systemd/system/mediagoblin.service
@ -9667,7 +9667,7 @@ function install_mediagoblin {
systemctl daemon-reload systemctl daemon-reload
systemctl enable mediagoblin systemctl enable mediagoblin
systemctl start mediagoblin systemctl start mediagoblin
# web config # web config
MEDIAGOBLIN_VIRTUAL_HOST=/etc/nginx/sites-available/$MEDIAGOBLIN_DOMAIN_NAME MEDIAGOBLIN_VIRTUAL_HOST=/etc/nginx/sites-available/$MEDIAGOBLIN_DOMAIN_NAME
echo 'server {' > $MEDIAGOBLIN_VIRTUAL_HOST echo 'server {' > $MEDIAGOBLIN_VIRTUAL_HOST
@ -9748,7 +9748,7 @@ function install_mediagoblin {
# update the dynamic DNS # update the dynamic DNS
CURRENT_DDNS_DOMAIN=$MEDIAGOBLIN_DOMAIN_NAME CURRENT_DDNS_DOMAIN=$MEDIAGOBLIN_DOMAIN_NAME
add_ddns_domain add_ddns_domain
echo 'install_mediagoblin' >> $COMPLETION_FILE echo 'install_mediagoblin' >> $COMPLETION_FILE
} }
@ -10442,7 +10442,7 @@ function install_sip_turn {
fi fi
fi fi
fi fi
echo '##' > /etc/turnserver/turnserver.conf echo '##' > /etc/turnserver/turnserver.conf
echo '# TurnServer configuration file.' >> /etc/turnserver/turnserver.conf echo '# TurnServer configuration file.' >> /etc/turnserver/turnserver.conf
echo '#' >> /etc/turnserver/turnserver.conf echo '#' >> /etc/turnserver/turnserver.conf
@ -10539,12 +10539,12 @@ function install_sip_turn {
echo '## Certification Authority file.' >> /etc/turnserver/turnserver.conf echo '## Certification Authority file.' >> /etc/turnserver/turnserver.conf
echo "ca_file = \"/etc/ssl/certs/ca-certificates.crt\"" >> /etc/turnserver/turnserver.conf echo "ca_file = \"/etc/ssl/certs/ca-certificates.crt\"" >> /etc/turnserver/turnserver.conf
echo '' >> /etc/turnserver/turnserver.conf echo '' >> /etc/turnserver/turnserver.conf
echo '## Server certificate file.' >> /etc/turnserver/turnserver.conf echo '## Server certificate file.' >> /etc/turnserver/turnserver.conf
if [ -f /etc/ssl/certs/$DEFAULT_DOMAIN_NAME.pem ]; then if [ -f /etc/ssl/certs/$DEFAULT_DOMAIN_NAME.pem ]; then
echo "cert_file = \"/etc/ssl/certs/$DEFAULT_DOMAIN_NAME.pem\"" >> /etc/turnserver/turnserver.conf echo "cert_file = \"/etc/ssl/certs/$DEFAULT_DOMAIN_NAME.pem\"" >> /etc/turnserver/turnserver.conf
else else
if [ -f /etc/ssl/certs/$DEFAULT_DOMAIN_NAME.crt ]; then if [ -f /etc/ssl/certs/$DEFAULT_DOMAIN_NAME.crt ]; then
echo "cert_file = \"/etc/ssl/certs/$DEFAULT_DOMAIN_NAME.crt\"" >> /etc/turnserver/turnserver.conf echo "cert_file = \"/etc/ssl/certs/$DEFAULT_DOMAIN_NAME.crt\"" >> /etc/turnserver/turnserver.conf
fi fi
fi fi
echo '' >> /etc/turnserver/turnserver.conf echo '' >> /etc/turnserver/turnserver.conf
@ -10561,7 +10561,7 @@ function install_sip_turn {
echo 'mod_tmpuser = false' >> /etc/turnserver/turnserver.conf echo 'mod_tmpuser = false' >> /etc/turnserver/turnserver.conf
echo "${MY_USERNAME}:password:${DEFAULT_DOMAIN_NAME}:authorized" > /etc/turnserver/turnusers.txt echo "${MY_USERNAME}:password:${DEFAULT_DOMAIN_NAME}:authorized" > /etc/turnserver/turnusers.txt
systemctl restart turnserver systemctl restart turnserver
echo 'install_sip_turn' >> $COMPLETION_FILE echo 'install_sip_turn' >> $COMPLETION_FILE