b641dcd501c1cfcfa7c07d7215f531bda042c875
[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/nginx/sites-available/mediagoblin
9 fcopy -Bv /etc/nginx/mediagoblin-common.conf
10
11 # Add installer to boot
12 $ROOTCMD update-rc.d install-mediagoblin defaults
13 fqdn=$HOSTNAME
14
15 # Replace Tokens
16 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/install-mediagoblin
17 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/mediagoblin-celery-worker
18 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/mediagoblin-paster
19
20 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/mediagoblin-templates/mediagolbin.ini
21 sed 's^GMG_SENDER_TOKEN^'$GMG_SENDER'^g' -i $target/etc/mediagoblin-templates/mediagolbin.ini
22
23 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/nginx/mediagoblin-common.conf
24
25 sed 's^GMG_FQDN_TOKEN^'$fqdn'^g' -i $target/etc/nginx/sites-available/mediagoblin
26
27 # enable nginx config
28 $ROOTCMD ln -s /etc/nginx/sites-available/mediagoblin /etc/nginx/sites-enabled/mediagoblin
29
30 if [ ! -f $target//etc/nginx/sites-enabled/default ]; then
31 $ROOTCMD rm /etc/nginx/sites-enabled/default
32 fi