42 if [ -d $bitnami/apps/enanocms ]; then |
50 if [ -d $bitnami/apps/enanocms ]; then |
43 echo "Enano is already installed as a module on this LAMPStack." |
51 echo "Enano is already installed as a module on this LAMPStack." |
44 exit 1 |
52 exit 1 |
45 fi |
53 fi |
46 |
54 |
47 mysql_port=$(cat $bitnami/properties.ini | grep mysql_port | sed -re 's/^mysql_port=//g') |
55 mysql_port=$(cat $bitnami/properties.ini | grep mysql_port | sed -$sedflags 's/^mysql_port=//g') |
48 |
56 |
49 while true; do |
57 while true; do |
50 read -s -p "MySQL root password: " mysqlpass |
58 read -s -p "MySQL root password: " mysqlpass |
51 echo "" |
59 echo "" |
52 out=`$mysqladmin -u root --password="$mysqlpass" ping 2>&1` |
60 out=`$mysqladmin -u root --password="$mysqlpass" ping 2>&1` |
78 </Directory> |
86 </Directory> |
79 EOF |
87 EOF |
80 cp ./uninstall.sh $bitnami/apps/enanocms/ |
88 cp ./uninstall.sh $bitnami/apps/enanocms/ |
81 |
89 |
82 echo "Patching Apache configuration." |
90 echo "Patching Apache configuration." |
83 if test x$(cat $bitnami/apache2/conf/httpd.conf | grep '^Include' | grep enanocms | wc -l) = x0; then |
91 if test "`cat $bitnami/apache2/conf/httpd.conf | grep '^Include' | grep enanocms | wc -l`" -eq 0; then |
84 echo -ne "\nInclude "'"'"$bitnami/apps/enanocms/conf/enanocms?conf"'"'"\n" >> $bitnami/apache2/conf/httpd.conf |
92 echo -ne "\nInclude "'"'"$bitnami/apps/enanocms/conf/enanocms?conf"'"'"\n" >> $bitnami/apache2/conf/httpd.conf |
85 fi |
93 fi |
86 |
94 |
87 echo "Adding Enano to BitNami's applications.html." |
95 echo "Adding Enano to BitNami's applications.html." |
88 if test x$(cat $bitnami/apache2/htdocs/applications.html | fgrep 'START BitNami Enano CMS Module enanocms' | wc -l) = x0; then |
96 if test "`cat $bitnami/apache2/htdocs/applications.html | fgrep 'START BitNami Enano CMS Module enanocms' | wc -l`" -eq 0; then |
89 cp enanocms-module.png $bitnami/apache2/htdocs/img/ |
97 cp enanocms-module.png $bitnami/apache2/htdocs/img/ |
90 line=$(cat $bitnami/apache2/htdocs/applications.html | fgrep -n '<!-- @@BITNAMI_MODULE_PLACEHOLDER@@ -->' | cut -d ':' -f 1) |
98 line=`cat $bitnami/apache2/htdocs/applications.html | fgrep -n '<!-- @@BITNAMI_MODULE_PLACEHOLDER@@ -->' | cut -d ':' -f 1` |
91 head -n $(($line - 1)) $bitnami/apache2/htdocs/applications.html > ./applications-temp.html |
99 head -n $(($line - 1)) $bitnami/apache2/htdocs/applications.html > ./applications-temp.html |
92 cat application.html >> ./applications-temp.html |
100 cat application.html >> ./applications-temp.html |
93 tail -n +$line $bitnami/apache2/htdocs/applications.html >> ./applications-temp.html |
101 tail -n +$line $bitnami/apache2/htdocs/applications.html >> ./applications-temp.html |
94 mv ./applications-temp.html $bitnami/apache2/htdocs/applications.html |
102 mv ./applications-temp.html $bitnami/apache2/htdocs/applications.html |
95 fi |
103 fi |