more tweaks to gmg
[fai-configs.git] / scripts / GMG / 15_install_gmg.sh
CommitLineData
353cecb8
LMM
1#!/bin/bash
2
cc84a658 3# Copy configs
e101f210 4fcopy -Bv /etc/init.d/install-mediagoblin
a72f8c44
LMM
5fcopy -Bv /etc/init.d/mediagoblin-paster
6fcopy -Bv /etc/init.d/mediagoblin-celery-worker
d5ce9fc0 7fcopy -Bv /etc/mediagoblin-templates/mediagoblin.ini
4e82f09a 8fcopy -Bv /etc/mediagoblin-templates/paste.ini
cc84a658
LMM
9fcopy -Bv /etc/nginx/sites-available/mediagoblin
10fcopy -Bv /etc/nginx/mediagoblin-common.conf
a72f8c44 11
cc84a658 12# Add installer to boot
bee0276b 13$ROOTCMD update-rc.d install-mediagoblin defaults
baf29c03 14fqdn=$HOSTNAME
cc84a658
LMM
15
16# Replace Tokens
a7362b30 17sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/install-mediagoblin
a72f8c44
LMM
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
cc84a658 20
c67630b5
LMM
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
451a1594
LMM
23
24sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/nginx/mediagoblin-common.conf
25
24781bc2 26sed 's^GMG_FQDN_TOKEN^'$fqdn'^g' -i $target/etc/nginx/sites-available/mediagoblin
e6a9ff79 27sed 's^SERVERNAME_TOKEN^'$fqdn'^g' -i $target/etc/nginx/sites-available/mediagoblin
451a1594 28
196d24cd 29# enable nginx config
24781bc2 30$ROOTCMD ln -s /etc/nginx/sites-available/mediagoblin /etc/nginx/sites-enabled/mediagoblin
24453202
LMM
31
32if [ ! -f $target//etc/nginx/sites-enabled/default ]; then
33 $ROOTCMD rm /etc/nginx/sites-enabled/default
34fi