5
# Copy our helper scripts to known locations
5
6
juju-log "Copying PHP scripts"
9
# Install the Juju helper PPA
10
juju-log "Adding Juju helper PPA"
11
add-apt-repository ppa:charmers/charm-helpers
8
14
juju-log "Installing required packages"
9
15
export DEBIAN_FRONTEND=noninteractive
10
apt-get install -y php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-gd mysql-client postfix unzip wget
12
juju-log "Downloading ThinkUp"
13
wget https://github.com/downloads/ginatrapani/ThinkUp/thinkup_1.0.zip -O /tmp/thinkup.zip
15
juju-log "Verifying archive integrity"
16
HASH=`md5sum /tmp/thinkup.zip`
17
if [[ $HASH != '46f7aeab776cbd443ff15b0d38509812 /tmp/thinkup.zip' ]] ; then
18
echo "Hash verification failed!"
16
apt-get install -y php5-cli libapache2-mod-php5 php5-mysql php5-curl php5-gd mysql-client postfix unzip
18
juju-log "Downloading and verifying ThinkUp"
19
. /usr/share/charm-helper/sh/net.sh
20
DOWNLOAD=`ch_get_file http://cloud.github.com/downloads/ginatrapani/ThinkUp/thinkup_1.0.2.zip 29629fd162fd53a101439229c701fc2f`
22
if [ -z "$DOWNLOAD" ]; then
23
juju-log "Failed to retrieve ThinkUp archive"
22
27
juju-log "Extracting ThinkUp"
24
unzip /tmp/thinkup.zip
26
31
juju-log "Relocating files to document root"
27
32
rm index.html # this file is placed by Apache, we don't need it