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