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