fixed typo
[fai-configs.git] / scripts / GMG / 15_install_gmg.sh
... / ...
CommitLineData
1#!/bin/bash
2
3# Copy configs
4fcopy -Bv /etc/init.d/install-mediagoblin
5fcopy -Bv /etc/init.d/mediagoblin-paster
6fcopy -Bv /etc/init.d/mediagoblin-celery-worker
7fcopy -Bv /etc/mediagoblin-templates/mediagoblin.ini
8fcopy -Bv /etc/mediagoblin-templates/paste.ini
9fcopy -Bv /etc/nginx/sites-available/mediagoblin
10fcopy -Bv /etc/nginx/mediagoblin-common.conf
11
12# Add installer to boot
13$ROOTCMD update-rc.d install-mediagoblin defaults
14fqdn=$HOSTNAME
15
16# Replace Tokens
17sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/install-mediagoblin
18sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/mediagoblin-celery-worker
19sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/mediagoblin-paster
20
21sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/mediagoblin-templates/mediagoblin.ini
22sed 's^GMG_SENDER_TOKEN^'$GMG_SENDER'^g' -i $target/etc/mediagoblin-templates/mediagoblin.ini
23
24sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/nginx/mediagoblin-common.conf
25
26sed 's^GMG_FQDN_TOKEN^'$fqdn'^g' -i $target/etc/nginx/sites-available/mediagoblin
27
28# enable nginx config
29$ROOTCMD ln -s /etc/nginx/sites-available/mediagoblin /etc/nginx/sites-enabled/mediagoblin
30
31if [ ! -f $target//etc/nginx/sites-enabled/default ]; then
32 $ROOTCMD rm /etc/nginx/sites-enabled/default
33fi