Merge pull request #302 from monotek/develop

postinstall.sh fixes
This commit is contained in:
André Bauer 2016-10-25 19:30:24 +02:00 committed by GitHub
commit ab6d2086d9

View file

@ -9,8 +9,11 @@ ZAMMAD_DIR="/opt/zammad"
DB="zammad_production" DB="zammad_production"
DB_USER="zammad" DB_USER="zammad"
# get existing db pass # check if database.yml exists
DB_PASS="$(grep "password:" < ${ZAMMAD_DIR}/config/database.yml | sed 's/.*password://')" if [ -f ${ZAMMAD_DIR}/config/database.yml ]; then
# get existing db pass
DB_PASS="$(grep "password:" < ${ZAMMAD_DIR}/config/database.yml | sed 's/.*password://')"
fi
# check if db pass exists # check if db pass exists
if [ -z "${DB_PASS}" ]; then if [ -z "${DB_PASS}" ]; then
@ -55,7 +58,7 @@ if [ -d /etc/nginx/sites-enabled ]; then
# copy nginx config # copy nginx config
test -f /etc/nginx/sites-available/zammad.conf || cp ${ZAMMAD_DIR}/contrib/nginx/sites-available/zammad.conf /etc/nginx/sites-available/zammad.conf test -f /etc/nginx/sites-available/zammad.conf || cp ${ZAMMAD_DIR}/contrib/nginx/sites-available/zammad.conf /etc/nginx/sites-available/zammad.conf
# creating symlink # creating symlink
test -h /etc/nginx/sites-available/zammad.conf || ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf test -f /etc/nginx/sites-available/zammad.conf || ln -s /etc/nginx/sites-available/zammad.conf /etc/nginx/sites-enabled/zammad.conf
# restart nginx # restart nginx
systemctl restart nginx systemctl restart nginx
fi fi