summaryrefslogtreecommitdiff
path: root/devgerrit/script/drupal.sh
blob: fcbb77c66b59c38bbf491188fa3f15953a407a09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
#===============================================================================
# Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
# Author onstudy@samsung.com
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#===============================================================================
HTDOCS_DIR=/var/www/html
MODULES_DIR=${HTDOCS_DIR}/drupal/sites/all/modules
set -e

if [ ! -e "${HTDOCS_DIR}/drupal/sites/default/settings.php" ]
then
   cp /config/settings.php ${HTDOCS_DIR}/drupal/sites/default/settings.php
   chmod a+w ${HTDOCS_DIR}/drupal/sites/default/settings.php
fi
if [ ! -e "${HTDOCS_DIR}/drupal/sites/default/default.settings.php" ]
then
   cp /config/default.settings.php ${HTDOCS_DIR}/drupal/sites/default/default.settings.php
   chmod a+w ${HTDOCS_DIR}/drupal/sites/default/default.settings.php
fi
if [  ! -d "${HTDOCS_DIR}/drupal/sites/default/files/" ]
then
   mkdir -p ${HTDOCS_DIR}/drupal/sites/default/files/
   chmod o+w ${HTDOCS_DIR}/drupal/sites/default/files/
fi

chown -R ${APACHE_RUN_USER}:${APACHE_RUN_USER} ${HTDOCS_DIR}/drupal