stage/autorun.sh
author Dan Fuhry <dan@enanocms.org>
Mon, 05 Jul 2010 23:57:56 -0400
changeset 5 7d3b7009399d
parent 4 c6c431cf0a89
permissions -rwxr-xr-x
Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     1
#!/bin/bash
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     2
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     3
## FUNCTIONS
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     4
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     5
check_bitnami_dir()
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     6
{
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     7
  test -d "$1" || return 1
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     8
  test -f "$1/ctlscript.sh" || return 1
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
     9
  test -f "$1/properties.ini" || return 1
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    10
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    11
  mysqladmin=$bitnami/mysql/bin/mysqladmin
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    12
  test -x "$mysqladmin" || return 1
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    13
  mysql=$bitnami/mysql/bin/mysql
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    14
  test -x "$mysql" || return 1
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    15
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    16
  return 0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    17
}
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    18
4
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    19
## COMPAT
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    20
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    21
# OS X sed (at least leopard and up) seem to support -E
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    22
sedflags=Ee
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    23
if ( sed --version 2>&1 | grep 'GNU sed' 2>&1 ) > /dev/null ; then
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    24
	sedflags=re
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    25
fi
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    26
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    27
## SCRIPT
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    28
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    29
cd `dirname $0`
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    30
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    31
echo "Welcome to the Enano CMS BitNami module installer."
5
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    32
if [ ! -d ./enano-* ]; then
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    33
	HG_BASE=${HG_BASE:-http://hg.enanocms.org/repos}
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    34
	cat <<EOF
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    35
This is the Mercurial-based installer. It doesn't include the Enano source
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    36
tree - instead it's created based on the latest Mercurial sources. To use this
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    37
installer, you must have Mercurial on your system.
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    38
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    39
The current repository path is ${HG_BASE}.
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    40
To override it, set HG_BASE.
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    41
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    42
You can safely Control-C out of this installer at any time and temporary files
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    43
will be cleaned up.
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    44
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    45
EOF
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    46
fi
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    47
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    48
autobitnami=""
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    49
if test -n "$HOME"; then
5
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    50
  autobitnami=`echo $HOME/lampstack-*`
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    51
  if test ! -d "$autobitnami"; then
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    52
    autobitnami=""
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    53
  fi
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    54
fi
5
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    55
if test -d /Applications/; then
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    56
	autobitnami=`echo /Applications/mampstack-*`
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    57
	if test ! -d "$autobitnami"; then
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    58
		autobitnami=""
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    59
	fi
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    60
fi
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    61
while true; do
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    62
  if test -n "$autobitnami"; then
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    63
    read -p "Path to BitNami directory [$autobitnami]: " bitnami
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    64
    test -z "$bitnami" && bitnami="$autobitnami"
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    65
  else
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    66
    read -p "Path to BitNami directory: " bitnami    
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    67
  fi
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    68
  check_bitnami_dir $bitnami && break
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    69
  echo "This does not seem to be the home of a BitNami LAMPStack installation."
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    70
done
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    71
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    72
if [ -d $bitnami/apps/enanocms ]; then
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    73
  echo "Enano is already installed as a module on this LAMPStack."
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    74
  exit 1
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    75
fi
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    76
4
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
    77
mysql_port=$(cat $bitnami/properties.ini | grep mysql_port | sed -$sedflags 's/^mysql_port=//g')
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    78
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    79
while true; do
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    80
  read -s -p "MySQL root password: " mysqlpass
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    81
  echo ""
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    82
  out=`$mysqladmin -u root --password="$mysqlpass" ping 2>&1`
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    83
  test "$out" = "mysqld is alive" && break
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    84
  echo $out
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    85
done
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    86
5
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    87
my_tr()
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    88
{
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    89
	# this is needed under OS X, its terminal emulator tends to mess up tr
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    90
	LC_ALL=C tr $@
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    91
	return $?
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    92
}
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    93
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    94
echo "Creating database."
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    95
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    96
bitnami_db="bn_enanocms"
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    97
bitnami_user="bn_enanocms"
5
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
    98
bitnami_pass=`dd if=/dev/urandom bs=256 count=1 2>/dev/null | my_tr -cd '\41-\46\50-\176' | cut -c 1-12`
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
    99
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   100
query='CREATE DATABASE IF NOT EXISTS `'$bitnami_db'`; GRANT ALL PRIVILEGES ON '$bitnami_db'.* TO '"$bitnami_user"'@localhost IDENTIFIED BY '"'$bitnami_pass'"'; FLUSH PRIVILEGES;'
3
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   101
echo "$query" | $mysql -u root --password="$mysqlpass" || exit 1
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   102
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   103
echo "Installing files."
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   104
mkdir -p $bitnami/apps/enanocms/{conf,licenses} || exit 1
5
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   105
if [ -d ./enano-* ]; then
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   106
	cp -r ./enano-* $bitnami/apps/enanocms/htdocs || exit 1
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   107
else
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   108
	# There's no Enano source tree in this installer. Pull the latest from Mercurial.
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   109
	oldpwd=`pwd`
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   110
	cd $bitnami/apps/enanocms || exit 1
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   111
	curl -q -o mkenanodev.sh http://hg.enanocms.org/mkenanodev.sh || exit 1
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   112
	chmod u+x mkenanodev.sh || exit 1
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   113
	./mkenanodev.sh 1.1 $HG_BASE || exit 1
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   114
	rm -f mkenanodev.sh
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   115
	mv enano-1.1 htdocs || exit 1
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   116
	
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   117
	cd $oldpwd
7d3b7009399d Added OS X tr workaround; added support for making Mercurial-only packages that pull Enano from Mercurial and install it using mkenanodev
Dan Fuhry <dan@enanocms.org>
parents: 4
diff changeset
   118
fi
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   119
cp ./COPYING $bitnami/apps/enanocms/licenses/ || exit 1
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   120
cat <<EOF > $bitnami/apps/enanocms/conf/enanocms.conf
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   121
Alias /enanocms "$bitnami/apps/enanocms/htdocs"
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   122
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   123
<Directory "$bitnami/apps/enanocms/htdocs">
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   124
    Options -Indexes MultiViews FollowSymLinks
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   125
    AllowOverride All
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   126
    Order allow,deny
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   127
    Allow from all
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   128
</Directory>
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   129
EOF
3
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   130
cp ./uninstall.sh $bitnami/apps/enanocms/
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   131
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   132
echo "Patching Apache configuration."
4
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
   133
if test "`cat $bitnami/apache2/conf/httpd.conf | grep '^Include' | grep enanocms | wc -l`" -eq 0; then
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   134
  echo -ne "\nInclude "'"'"$bitnami/apps/enanocms/conf/enanocms?conf"'"'"\n" >> $bitnami/apache2/conf/httpd.conf
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   135
fi
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   136
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   137
echo "Adding Enano to BitNami's applications.html."
4
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
   138
if test "`cat $bitnami/apache2/htdocs/applications.html | fgrep 'START BitNami Enano CMS Module enanocms' | wc -l`" -eq 0; then
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   139
  cp enanocms-module.png $bitnami/apache2/htdocs/img/
4
c6c431cf0a89 OS X compatibility hell yeah!
Dan Fuhry <dan@enanocms.org>
parents: 3
diff changeset
   140
  line=`cat $bitnami/apache2/htdocs/applications.html | fgrep -n '<!-- @@BITNAMI_MODULE_PLACEHOLDER@@ -->' | cut -d ':' -f 1`
0
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   141
  head -n $(($line - 1)) $bitnami/apache2/htdocs/applications.html > ./applications-temp.html
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   142
  cat application.html >> ./applications-temp.html
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   143
  tail -n +$line $bitnami/apache2/htdocs/applications.html >> ./applications-temp.html
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   144
  mv ./applications-temp.html $bitnami/apache2/htdocs/applications.html
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   145
fi
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   146
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   147
echo "Starting Enano installer."
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   148
while true; do
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   149
  if $bitnami/php/bin/php $bitnami/apps/enanocms/htdocs/install/install-cli.php -b mysql -h 127.0.0.1 -o $mysql_port -u "$bitnami_user" -p "$bitnami_pass" -d $bitnami_db -i /enanocms -r rewrite
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   150
  then
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   151
    break
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   152
  else
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   153
    read -n 1 -p "Try installation again? [y/N] " RETRY
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   154
    if test "$RETRY" != "y"; then
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   155
      cat <<EOF
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   156
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   157
Enano installation failed. To install Enano using the web interface,
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   158
navigate to http://localhost/enanocms (or http://localhost:8080/enanocms,
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   159
depending on how you installed LAMPStack), and use the following settings:
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   160
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   161
  Database type:       MySQL
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   162
  Database hostname:   localhost
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   163
  Database name:       $bitnami_db
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   164
  Database username:   $bitnami_user
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   165
  Database password:   $bitnami_pass
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   166
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   167
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   168
EOF
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   169
      break
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   170
    fi
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   171
  fi
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   172
done
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   173
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   174
echo "Restarting Apache."
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   175
$bitnami/ctlscript.sh restart apache
8e044e762a6c First revision, but working.
Dan
parents:
diff changeset
   176
3
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   177
echo
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   178
echo -e "Installation finished, \e[31;1mbut be warned! We are aware of a bug with BitNami's"
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   179
echo -e "copy of GMP.\e[0m If your server doesn't support SSE2, Enano logins may fail. A"
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   180
echo -e "symptom of this problem is messages similar to the following in your Apache"
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   181
echo -e "error log and a blank response when you try to log in to your Enano website:"
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   182
echo
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   183
echo -e "\t[Mon Jul 05 14:22:10 2010] [notice] child pid 26544 exit signal"
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   184
echo -e "\tIllegal instruction (4)"
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   185
echo
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   186
echo -e "If you experience this bug, please report it to BitNami, not the Enano project."
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   187
echo
859eeb3579b2 Added uninstall script and warning about SSE2-only build of GMP
Dan Fuhry <dan@enanocms.org>
parents: 0
diff changeset
   188