2016-12-02 11:24:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# packager.io postinstall script functions
|
|
|
|
#
|
|
|
|
|
2016-12-06 18:12:19 +00:00
|
|
|
function debug() {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${DEBUG}" == "yes" ]; then
|
|
|
|
echo "DEBUG MODE ON"
|
|
|
|
set -ex
|
|
|
|
fi
|
2016-12-06 18:12:19 +00:00
|
|
|
}
|
|
|
|
|
2016-12-02 11:24:00 +00:00
|
|
|
function detect_os () {
|
2017-02-12 11:52:10 +00:00
|
|
|
. /etc/os-release
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${ID}" == "debian" ] || [ "${ID}" == "ubuntu" ]; then
|
|
|
|
OS="DEBIAN"
|
|
|
|
elif [ "${ID}" == "centos" ] || [ "${ID}" == "fedora" ] || [ "${ID}" == "rhel" ]; then
|
|
|
|
OS="REDHAT"
|
|
|
|
elif [ "${ID}" == "opensuse" ] || [ "${ID}" == "sles" ] || [ "${ID}" == "suse" ]; then
|
|
|
|
OS="SUSE"
|
|
|
|
else
|
|
|
|
OS="UNKNOWN"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${DEBUG}" == "yes" ]; then
|
|
|
|
echo "OS is ${OS} based"
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
2016-12-06 14:51:33 +00:00
|
|
|
function detect_docker() {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ -n "$(grep docker < /proc/1/cgroup)" ]; then
|
|
|
|
DOCKER="yes"
|
|
|
|
else
|
|
|
|
DOCKER="no"
|
|
|
|
fi
|
2016-12-06 14:51:33 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${DEBUG}" == "yes" ]; then
|
|
|
|
echo "os runs in docker container = ${DOCKER}"
|
|
|
|
fi
|
2016-12-06 14:51:33 +00:00
|
|
|
}
|
|
|
|
|
2016-12-02 11:24:00 +00:00
|
|
|
function detect_initcmd () {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ -n "$(which systemctl 2> /dev/null)" ]; then
|
|
|
|
INIT_CMD="systemctl"
|
|
|
|
elif [ -n "$(which initctl 2> /dev/null)" ]; then
|
|
|
|
INIT_CMD="initctl"
|
|
|
|
else
|
|
|
|
function sysvinit () {
|
|
|
|
service $2 $1
|
|
|
|
}
|
|
|
|
INIT_CMD="sysvinit"
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${DOCKER}" == "yes" ]; then
|
|
|
|
INIT_CMD="initctl"
|
|
|
|
fi
|
2016-12-06 14:51:33 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${DEBUG}" == "yes" ]; then
|
|
|
|
echo "INIT CMD = ${INIT_CMD}"
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
2016-12-06 14:51:33 +00:00
|
|
|
|
2016-12-02 11:24:00 +00:00
|
|
|
function detect_database () {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ -n "$(which psql 2> /dev/null)" ]; then
|
|
|
|
ADAPTER="postgresql"
|
|
|
|
elif [ -n "$(which mysql 2> /dev/null)" ]; then
|
|
|
|
ADAPTER="mysql2"
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${DEBUG}" == "yes" ]; then
|
|
|
|
echo "Use ${ADAPTER} adapter in database.yml"
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function detect_webserver () {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ -n "$(which nginx 2> /dev/null)" ] ; then
|
|
|
|
WEBSERVER="nginx"
|
|
|
|
WEBSERVER_CMD="nginx"
|
|
|
|
if [ "${OS}" == "DEBIAN" ]; then
|
2017-06-24 08:43:01 +00:00
|
|
|
WEBSERVER_CONF="/etc/nginx/sites-available/zammad.conf"
|
2017-02-12 11:52:10 +00:00
|
|
|
elif [ "${OS}" == "REDHAT" ]; then
|
|
|
|
WEBSERVER_CONF="/etc/nginx/conf.d/zammad.conf"
|
|
|
|
elif [ "${OS}" == "SUSE" ]; then
|
|
|
|
WEBSERVER_CONF="/etc/nginx/vhosts.d/zammad.conf"
|
|
|
|
fi
|
|
|
|
elif [ -n "$(which apache2 2> /dev/null)" ]; then
|
|
|
|
WEBSERVER="apache2"
|
|
|
|
WEBSERVER_CMD="apache2"
|
|
|
|
if [ "${OS}" == "DEBIAN" ]; then
|
2017-06-24 08:43:01 +00:00
|
|
|
WEBSERVER_CONF="/etc/apache2/sites-available/zammad.conf"
|
2016-12-02 11:24:00 +00:00
|
|
|
fi
|
2017-02-12 11:52:10 +00:00
|
|
|
elif [ -n "$(which httpd 2> /dev/null)" ]; then
|
|
|
|
WEBSERVER="apache2"
|
|
|
|
WEBSERVER_CMD="httpd"
|
|
|
|
if [ "${OS}" == "REDHAT" ]; then
|
|
|
|
WEBSERVER_CONF="/etc/httpd/conf.d/zammad.conf"
|
|
|
|
elif [ "${OS}" == "SUSE" ]; then
|
|
|
|
WEBSERVER_CONF="/etc/apache2/vhosts.d/zammad.conf"
|
2016-12-02 11:24:00 +00:00
|
|
|
fi
|
2017-02-12 11:52:10 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${DEBUG}" == "yes" ]; then
|
|
|
|
echo "Webserver is ${WEBSERVER_CMD}"
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function create_initscripts () {
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# (Re)creating init scripts"
|
|
|
|
zammad scale web=${ZAMMAD_WEBS} websocket=${ZAMMAD_WEBSOCKETS} worker=${ZAMMAD_WORKERS}
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Enabling Zammad on boot"
|
|
|
|
${INIT_CMD} enable zammad
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function start_zammad () {
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Starting Zammad"
|
|
|
|
${INIT_CMD} start zammad
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function stop_zammad () {
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Stopping Zammad"
|
|
|
|
${INIT_CMD} stop zammad
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function create_database_password () {
|
2017-02-12 11:52:10 +00:00
|
|
|
DB_PASS="$(tr -dc A-Za-z0-9 < /dev/urandom | head -c10)"
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function create_postgresql_db () {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ -n "$(which postgresql-setup 2> /dev/null)" ]; then
|
|
|
|
echo "# Preparing postgresql server"
|
|
|
|
postgresql-setup initdb
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Creating postgresql bootstart"
|
|
|
|
${INIT_CMD} enable postgresql.service
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Restarting postgresql server"
|
|
|
|
${INIT_CMD} restart postgresql
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Creating zammad postgresql user"
|
|
|
|
echo "CREATE USER \"${DB_USER}\" WITH PASSWORD '${DB_PASS}';" | su - postgres -c psql
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-06-03 14:32:15 +00:00
|
|
|
echo "# Creating zammad postgresql db"
|
|
|
|
su - postgres -c "createdb -E UTF8 ${DB} -O ${DB_USER}"
|
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Grant privileges to new postgresql user"
|
|
|
|
echo "GRANT ALL PRIVILEGES ON DATABASE \"${DB}\" TO \"${DB_USER}\";" | su - postgres -c psql
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function create_mysql_db () {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ -f "${MY_CNF}" ]; then
|
|
|
|
MYSQL_CREDENTIALS="--defaults-file=${MY_CNF}"
|
|
|
|
else
|
|
|
|
echo -n "Please enter your MySQL root password:"
|
2017-02-12 12:17:55 +00:00
|
|
|
read -p 'Password: ' MYSQL_ROOT_PASS
|
2017-02-12 11:52:10 +00:00
|
|
|
MYSQL_CREDENTIALS="-u root -p${MYSQL_ROOT_PASS}"
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Creating zammad mysql db"
|
|
|
|
mysql ${MYSQL_CREDENTIALS} -e "CREATE DATABASE ${DB} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;"
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Creating zammad mysql user"
|
|
|
|
mysql ${MYSQL_CREDENTIALS} -e "CREATE USER \"${DB_USER}\"@\"${DB_HOST}\" IDENTIFIED BY \"${DB_PASS}\";"
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Grant privileges to new mysql user"
|
|
|
|
mysql ${MYSQL_CREDENTIALS} -e "GRANT ALL PRIVILEGES ON ${DB}.* TO \"${DB_USER}\"@\"${DB_HOST}\"; FLUSH PRIVILEGES;"
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function update_database_yml () {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${OS}" == "REDHAT" ] || [ "${OS}" == "SUSE" ]; then
|
|
|
|
if [ "${ADAPTER}" == "postgresql" ]; then
|
|
|
|
DB_PASS=""
|
2016-12-02 11:24:00 +00:00
|
|
|
fi
|
2017-02-12 11:52:10 +00:00
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Updating database.yml"
|
|
|
|
sed -e "s/.*adapter:.*/ adapter: ${ADAPTER}/" \
|
|
|
|
-e "s/.*username:.*/ username: ${DB_USER}/" \
|
|
|
|
-e "s/.*password:.*/ password: ${DB_PASS}/" \
|
2018-05-10 10:51:19 +00:00
|
|
|
-e "s/.*database:.*/ database: ${DB}/" < ${ZAMMAD_DIR}/contrib/packager.io/database.yml.pkgr > ${ZAMMAD_DIR}/config/database.yml
|
2021-11-04 10:32:37 +00:00
|
|
|
|
|
|
|
echo "# ... Fixing permission database.yml"
|
|
|
|
chown zammad:zammad ${ZAMMAD_DIR}/config/database.yml
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function initialise_database () {
|
2017-02-12 11:52:10 +00:00
|
|
|
zammad run rake db:migrate
|
|
|
|
zammad run rake db:seed
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function update_database () {
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# database.yml found. Updating db..."
|
|
|
|
zammad run rake db:migrate
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
2017-10-25 10:36:07 +00:00
|
|
|
function update_translations () {
|
|
|
|
echo "# Updating translations..."
|
|
|
|
zammad run rails r 'Locale.sync'
|
|
|
|
zammad run rails r 'Translation.sync'
|
|
|
|
}
|
|
|
|
|
2016-12-02 11:24:00 +00:00
|
|
|
function create_webserver_config () {
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${OS}" == "DEBIAN" ]; then
|
2017-06-24 08:43:01 +00:00
|
|
|
if [ ! -f "${WEBSERVER_CONF}" ]; then
|
2017-06-24 09:51:16 +00:00
|
|
|
if [ -f "/etc/${WEBSERVER}/sites-enabled/zammad.conf" ]; then
|
|
|
|
mv /etc/${WEBSERVER}/sites-enabled/zammad.conf ${WEBSERVER_CONF}
|
|
|
|
else
|
|
|
|
cp ${ZAMMAD_DIR}/contrib/${WEBSERVER}/zammad.conf ${WEBSERVER_CONF}
|
2017-09-16 23:39:12 +00:00
|
|
|
fi
|
2017-06-24 08:43:01 +00:00
|
|
|
ln -s ${WEBSERVER_CONF} /etc/${WEBSERVER}/sites-enabled/zammad.conf
|
|
|
|
fi
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${WEBSERVER}" == "apache2" ]; then
|
|
|
|
a2enmod proxy
|
|
|
|
a2enmod proxy_http
|
|
|
|
a2enmod proxy_wstunnel
|
2016-12-02 11:24:00 +00:00
|
|
|
fi
|
2017-02-12 11:52:10 +00:00
|
|
|
else
|
|
|
|
test -f ${WEBSERVER_CONF} || cp ${ZAMMAD_DIR}/contrib/${WEBSERVER}/zammad.conf ${WEBSERVER_CONF}
|
|
|
|
fi
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Creating webserver bootstart"
|
|
|
|
${INIT_CMD} enable ${WEBSERVER_CMD}
|
2016-12-02 11:24:00 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
echo "# Restarting webserver ${WEBSERVER_CMD}"
|
|
|
|
${INIT_CMD} restart ${WEBSERVER_CMD}
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|
|
|
|
|
2017-09-16 23:39:12 +00:00
|
|
|
function setup_elasticsearch () {
|
|
|
|
echo "# Configuring Elasticsearch..."
|
2017-12-09 13:31:30 +00:00
|
|
|
|
2021-09-28 19:03:29 +00:00
|
|
|
ES_CONNECTION="$(zammad run rails r "puts '',Setting.get('es_url')"| tail -n 1 2>> /dev/null)"
|
2018-07-31 06:29:04 +00:00
|
|
|
|
2018-07-31 08:06:20 +00:00
|
|
|
if [ -z "${ES_CONNECTION}" ]; then
|
2019-11-27 09:23:05 +00:00
|
|
|
echo "-- Nevermind, no es_url is set, leaving Elasticsearch untouched ...!"
|
|
|
|
echo "-- The above is all right if you don't want to use Elasticsearch (locally) - if this is not intended, consult https://docs.zammad.org !"
|
|
|
|
return 0
|
2018-07-31 08:06:20 +00:00
|
|
|
fi
|
|
|
|
|
2017-12-09 13:31:30 +00:00
|
|
|
if [ -n "$(/usr/share/elasticsearch/bin/elasticsearch-plugin list | grep mapper-attachments)" ]; then
|
|
|
|
REBUILD_ES_SEARCHINDEX="yes"
|
2018-03-14 12:51:57 +00:00
|
|
|
|
2018-08-10 00:14:51 +00:00
|
|
|
echo "# Deleting old elasticsearch index..."
|
|
|
|
zammad run rake searchindex:drop
|
2018-03-14 12:51:57 +00:00
|
|
|
|
2017-12-09 13:31:30 +00:00
|
|
|
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s remove mapper-attachments
|
2018-03-14 12:51:57 +00:00
|
|
|
|
2017-12-09 13:31:30 +00:00
|
|
|
elif [ -n "$(/usr/share/elasticsearch/bin/elasticsearch-plugin list | grep ingest-attachment)" ]; then
|
|
|
|
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s remove ingest-attachment
|
|
|
|
fi
|
|
|
|
|
|
|
|
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s install ingest-attachment
|
|
|
|
|
2018-12-13 10:05:07 +00:00
|
|
|
if [ "${ES_CONNECTION}" == "http://127.0.0.1:9200" ] || [ "${ES_CONNECTION}" == "http://localhost:9200" ]; then
|
2018-07-31 08:06:20 +00:00
|
|
|
${INIT_CMD} restart elasticsearch
|
|
|
|
else
|
|
|
|
echo -e "\n It seems you're running an external Elasticsearch server on ${ES_CONNECTION}"
|
2019-11-27 09:23:05 +00:00
|
|
|
echo -e "\n We'll not touch your Elasticsearch on the local and remote system."
|
2018-07-31 08:06:20 +00:00
|
|
|
echo -e "\n Please get sure to install the 'ingest-attachment' plugin on your Elasticsearch server by:"
|
|
|
|
echo -e "/usr/share/elasticsearch/bin/elasticsearch-plugin -s install ingest-attachment"
|
|
|
|
echo -e "\nAfter this you might need to rebuild the searchindex by:"
|
|
|
|
echo -e "zammad run rake searchindex:rebuild"
|
|
|
|
fi
|
2017-09-16 23:51:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function elasticsearch_searchindex_rebuild () {
|
2018-07-31 08:06:20 +00:00
|
|
|
zammad run rails r "Setting.set('es_url', \"${ES_CONNECTION}\")"
|
2017-12-09 13:48:45 +00:00
|
|
|
|
2017-12-09 13:31:30 +00:00
|
|
|
if [ "${REBUILD_ES_SEARCHINDEX}" == "yes" ]; then
|
|
|
|
echo "# (Re)building Elasticsearch searchindex..."
|
2017-12-09 13:48:45 +00:00
|
|
|
nohup zammad run rake searchindex:rebuild &> ${ZAMMAD_DIR}/log/searchindex-rebuild.log &
|
2017-12-09 13:31:30 +00:00
|
|
|
fi
|
2017-09-16 23:39:12 +00:00
|
|
|
}
|
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
function update_or_install () {
|
2017-12-09 13:31:30 +00:00
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ -f ${ZAMMAD_DIR}/config/database.yml ]; then
|
2021-10-14 06:31:04 +00:00
|
|
|
|
|
|
|
echo "# Clear cache..."
|
|
|
|
zammad run rails r Cache.clear
|
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
update_database
|
2017-10-25 10:36:07 +00:00
|
|
|
|
|
|
|
update_translations
|
2017-02-12 11:52:10 +00:00
|
|
|
else
|
2017-12-09 13:31:30 +00:00
|
|
|
REBUILD_ES_SEARCHINDEX="yes"
|
2017-02-12 11:52:10 +00:00
|
|
|
create_database_password
|
|
|
|
|
|
|
|
if [ "${ADAPTER}" == "postgresql" ]; then
|
|
|
|
echo "# Installing zammad on postgresql"
|
|
|
|
create_postgresql_db
|
|
|
|
elif [ "${ADAPTER}" == "mysql2" ]; then
|
|
|
|
echo "# Installing zammad on mysql"
|
|
|
|
create_mysql_db
|
2016-12-02 11:24:00 +00:00
|
|
|
fi
|
2017-02-12 11:52:10 +00:00
|
|
|
|
|
|
|
update_database_yml
|
|
|
|
|
|
|
|
initialise_database
|
|
|
|
fi
|
2017-12-09 13:48:45 +00:00
|
|
|
|
2018-08-10 00:14:51 +00:00
|
|
|
setup_elasticsearch
|
|
|
|
|
2017-12-09 13:31:30 +00:00
|
|
|
elasticsearch_searchindex_rebuild
|
2021-11-02 12:30:10 +00:00
|
|
|
|
|
|
|
echo "# Enforcing 0600 on database.yml ..."
|
|
|
|
chmod 600 ${ZAMMAD_DIR}/config/database.yml
|
2017-02-12 11:52:10 +00:00
|
|
|
}
|
|
|
|
|
2017-06-17 09:25:47 +00:00
|
|
|
function set_env_vars () {
|
2019-10-29 13:49:03 +00:00
|
|
|
zammad config:set RUBY_MALLOC_ARENA_MAX=${ZAMMAD_RUBY_MALLOC_ARENA_MAX:=2}
|
2017-06-17 09:30:01 +00:00
|
|
|
zammad config:set RUBY_GC_MALLOC_LIMIT=${ZAMMAD_RUBY_GC_MALLOC_LIMIT:=1077216}
|
|
|
|
zammad config:set RUBY_GC_MALLOC_LIMIT_MAX=${ZAMMAD_RUBY_GC_MALLOC_LIMIT_MAX:=2177216}
|
|
|
|
zammad config:set RUBY_GC_OLDMALLOC_LIMIT=${ZAMMAD_RUBY_GC_OLDMALLOC_LIMIT:=2177216}
|
|
|
|
zammad config:set RUBY_GC_OLDMALLOC_LIMIT_MAX=${ZAMMAD_RUBY_GC_OLDMALLOC_LIMIT_MAX:=3000100}
|
2019-07-11 13:43:20 +00:00
|
|
|
if [[ "$(zammad config:get RAILS_LOG_TO_STDOUT)" == "enabled" ]];then
|
|
|
|
echo 'Setting default Logging to file, set via "zammad config:set RAILS_LOG_TO_STDOUT=true" if you want to log to STDOUT!'
|
|
|
|
zammad config:set RAILS_LOG_TO_STDOUT=
|
|
|
|
fi
|
|
|
|
|
2017-06-17 09:25:47 +00:00
|
|
|
}
|
|
|
|
|
2017-02-12 11:52:10 +00:00
|
|
|
function final_message () {
|
|
|
|
echo -e "####################################################################################"
|
2017-04-23 09:58:17 +00:00
|
|
|
echo -e "\nAdd your fully qualified domain name or public IP to servername directive of"
|
|
|
|
echo -e "${WEBSERVER}, if this installation is done on a remote server. You have to change:"
|
|
|
|
echo -e "${WEBSERVER_CONF} and restart ${WEBSERVER_CMD} process."
|
|
|
|
echo -e "Otherwise just open http://localhost/ in your browser to start using Zammad.\n"
|
2017-02-12 11:52:10 +00:00
|
|
|
if [ "${OS}" == "REDHAT" ]; then
|
|
|
|
echo -e "\n Remember to enable selinux and firewall rules!\n"
|
2017-04-23 09:58:17 +00:00
|
|
|
echo -e "Use the following commands:"
|
2017-02-12 11:52:10 +00:00
|
|
|
echo -e " setsebool httpd_can_network_connect on -P"
|
|
|
|
echo -e " firewall-cmd --zone=public --add-service=http --permanent"
|
|
|
|
echo -e " firewall-cmd --zone=public --add-service=https --permanent"
|
|
|
|
echo -e " firewall-cmd --reload\n"
|
2017-04-23 10:37:54 +00:00
|
|
|
elif [ "${OS}" == "SUSE" ]; then
|
|
|
|
echo -e "\n Make sure that the firewall is not blocking port 80 & 443!\n"
|
|
|
|
echo -e "Use 'yast firewall' or 'SuSEfirewall2' commands to configure it"
|
2017-02-12 11:52:10 +00:00
|
|
|
fi
|
|
|
|
echo -e "####################################################################################"
|
2016-12-02 11:24:00 +00:00
|
|
|
}
|