Fixed code for setting up user's web root

This commit is contained in:
Duncan Sommerville 2015-01-14 20:15:47 -05:00
parent 3452e13f5e
commit b338c5cf0d
1 changed files with 17 additions and 17 deletions

34
install
View File

@ -29,16 +29,13 @@ showhelp () {
this setting if you've changed the default apache web user this setting if you've changed the default apache web user
-r, --web-root=WEB_ROOT -r, --web-root=WEB_ROOT
Set the web root for Airtime files Set the web root for Airtime files
This will copy the Airtime application files and make them This will copy the Airtime application files, but you will need
accessible to the web user to give your web user access to the given directory if it is
If no directory or an empty string is given, this defaults to not accessible
an in-place installation, and will give the web user
permissions on the current Airtime root
-I, --in-place -I, --in-place
Set the current Airtime root as the working directory for Set the current Airtime directory as the web root
Airtime Note that you will need to give your web user permission to
Note that you will need to give your web user permissions on access this directory if it is not accessible
these directories
-p, --postgres -p, --postgres
Create a default postgres user named 'airtime' with password Create a default postgres user named 'airtime' with password
'airtime' 'airtime'
@ -274,6 +271,8 @@ loudCmd "apt-get install -y --force-yes lsb-release"
dist=`lsb_release -is` dist=`lsb_release -is`
code=`lsb_release -cs` code=`lsb_release -cs`
verbose "\n * Adding apt.sourcefabric to sources.list..."
set +e set +e
grep -E "deb +http://apt.sourcefabric.org/? +$code +main" /etc/apt/sources.list grep -E "deb +http://apt.sourcefabric.org/? +$code +main" /etc/apt/sources.list
returncode=$? returncode=$?
@ -282,22 +281,23 @@ if [ "$returncode" != "0" ]; then
echo "deb http://apt.sourcefabric.org/ $code main" >> /etc/apt/sources.list echo "deb http://apt.sourcefabric.org/ $code main" >> /etc/apt/sources.list
apt-get update apt-get update
fi fi
verbose "...Done"
if [ "$in_place" = "t" ]; then if [ "$in_place" = "t" ]; then
verbose "\n * Setting current Airtime directory as web root..." verbose "\n * Setting current Airtime directory as web root..."
web_root=${AIRTIMEROOT}/airtime_mvc/public web_root=${AIRTIMEROOT}/airtime_mvc/public
chmod -R 755 ${AIRTIMEROOT}
elif [ -n "$web_root" ]; then elif [ -n "$web_root" ]; then
verbose "\n * Creating Apache web root directory..." verbose "\n * Creating Apache web root directory..."
mkdir -p ${web_root}/airtime/public/ cp -R ${AIRTIMEROOT}/airtime_mvc/* ${web_root}
cp -R ${AIRTIMEROOT}/airtime_mvc/* ${web_root}/airtime/ web_root=${web_root}/public/
chmod -R 755 ${web_root}
else else
verbose "\n * Creating default Apache web root directory /usr/share/airtime/..." verbose "\n * Creating default Apache web root directory /usr/share/airtime/..."
web_root="/usr/share" web_root="/usr/share/airtime"
mkdir -p ${web_root}/airtime/public/ mkdir -p ${web_root}
cp -R ${AIRTIMEROOT}/airtime_mvc/* ${web_root}/airtime/ cp -R ${AIRTIMEROOT}/airtime_mvc/* ${web_root}
web_root=${web_root}/public/
fi fi
verbose "...Done"
if [ "$apache" = "t" ]; then if [ "$apache" = "t" ]; then
loud "\n-----------------------------------------------------" loud "\n-----------------------------------------------------"
@ -549,7 +549,7 @@ loud " * Installing Locales * "
loud "-----------------------------------------------------" loud "-----------------------------------------------------"
set +e set +e
verbose "Generating locales" verbose "\n * Generating locales"
for i in `ls /usr/share/airtime/locale | grep ".._.."`; do for i in `ls /usr/share/airtime/locale | grep ".._.."`; do
if [ "$dist" = "Debian" ]; then if [ "$dist" = "Debian" ]; then
grep -qi "^$i" /etc/locale.gen grep -qi "^$i" /etc/locale.gen