X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=contrib%2Fsetupserver.sh;h=8d233bfc1441c66f23a4273fbf77c20c1683772d;hb=03a00881dabd9f18a2cc714f76057fc5fc2a4463;hp=96729fbb92198cbc84e7202b1ba63749bcd2d497;hpb=a4ea535bfca29425422f4f3183ed75df19de17c8;p=ga4php.git diff --git a/contrib/setupserver.sh b/contrib/setupserver.sh index 96729fb..8d233bf 100755 --- a/contrib/setupserver.sh +++ b/contrib/setupserver.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #################### # The purpose of this script is to setup a built ubuntu 10.04 @@ -37,3 +37,53 @@ case "$1" in exit 0 esac +# ok, we're ready to function, tell the user some stuff +echo "This script will now install packages required for the server to work" +echo "as well as install the auth server and start scripts into /opt/gaas and" +echo "/etc/init.d/. I will try to do this as quitely as possible" + +read -p "are you sure [y/N]? " surity + +if [ "x$surity" != "xy" ] +then + echo "Bailing, must hit y if you are sure" + exit 0 +fi + +# first install apt packages for apache and php +echo "Beginning install of apt-get packages" +apt-get install -y apache2 libapache2-mod-php5 php-soap php5-ldap php5-cli php5-adodb subversion qrencode > /dev/null 2>&1 + +if [ "$?" != "0" ] +then + echo "There was a problem during install of apt-get packages" + exit 1 +fi + +echo "Apt-get packages installed, getting auth server code" + +# get the auth server code from svn +MYTMPDIR="/tmp/ga$RANDOM" +mkdir -p $MYTMPDIR +cd $MYTMPDIR +svn checkout http://ga4php.googlecode.com/svn/trunk/ ga4php > /dev/null 2>&1 +if [ "$?" != "0" ] +then + echo "There was a problem downloading the authserver source code.. bailing" + exit 2 +fi + +echo "Code downloaded, beginning installation into /opt/gaas" + +mkdir /opt/gaas +cp -r * /opt/gaas + +echo "Createing service user" +useradd -d /opt/gaas -r gaas -m + +chown -R gaas:gaas /opt/gaas +echo "Tightening up permissions" +chmod 700 /opt/gaas/authserver/authd +chmod 770 /opt/gaas/authserver/ + +echo "Users who wish to use the gaas system must now be added to the gaas group"