fixes for gmg0p, which is t10
[fai-configs.git] / scripts / GMG / 15_install_gmg.sh
index d3f563d4231379670ae54ecac0a9260a50f495af..8cfb0f872fc5f443547ba1e2a0ba5d93eae20e89 100755 (executable)
@@ -5,22 +5,30 @@ fcopy -Bv /etc/init.d/install-mediagoblin
 fcopy -Bv /etc/init.d/mediagoblin-paster
 fcopy -Bv /etc/init.d/mediagoblin-celery-worker
 fcopy -Bv /etc/mediagoblin-templates/mediagoblin.ini
+fcopy -Bv /etc/mediagoblin-templates/paste.ini
 fcopy -Bv /etc/nginx/sites-available/mediagoblin
 fcopy -Bv /etc/nginx/mediagoblin-common.conf
 
 # Add installer to boot
 $ROOTCMD update-rc.d install-mediagoblin defaults
-fqdn=$HOSTNAME.$DOMAIN
+fqdn=$HOSTNAME
 
 # Replace Tokens
 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/install-mediagoblin
 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/mediagoblin-celery-worker
 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/init.d/mediagoblin-paster
 
-sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/mediagoblin-templates/mediagolbin.ini
-sed 's^GMG_SENDER_TOKEN^'$GMG_SENDER'^g' -i $target/etc/mediagoblin-templates/mediagolbin.ini
+sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/mediagoblin-templates/mediagoblin.ini
+sed 's^GMG_SENDER_TOKEN^'$GMG_SENDER'^g' -i $target/etc/mediagoblin-templates/mediagoblin.ini
 
 sed 's^GMG_PATH_TOKEN^'$GMG_PATH'^g' -i $target/etc/nginx/mediagoblin-common.conf
 
-sed 's^GMG_FQDN_TOKEN^'$fqdn'^g' -i $target/etc/nginx/sites-available/mediagoblin-common.conf
+sed 's^GMG_FQDN_TOKEN^'$fqdn'^g' -i $target/etc/nginx/sites-available/mediagoblin
+sed 's^SERVERNAME_TOKEN^'$SERVERNAME'^g' -i $target/etc/nginx/sites-available/mediagoblin
 
+# enable nginx config
+$ROOTCMD ln -s /etc/nginx/sites-available/mediagoblin /etc/nginx/sites-enabled/mediagoblin
+
+if [ ! -f $target//etc/nginx/sites-enabled/default ]; then
+       $ROOTCMD rm /etc/nginx/sites-enabled/default
+fi