Fixed path variable to www-root dir

This commit is contained in:
Alexey Pustovalov
2021-02-17 08:37:07 -05:00
13 changed files with 66 additions and 69 deletions

View File

@ -11,19 +11,20 @@ fi
# Default Zabbix installation name
# Used only by Zabbix web-interface
ZBX_SERVER_NAME=${ZBX_SERVER_NAME:-"Zabbix docker"}
: ${ZBX_SERVER_NAME:="Zabbix docker"}
# Default Zabbix server host
ZBX_SERVER_HOST=${ZBX_SERVER_HOST:-"zabbix-server"}
: ${ZBX_SERVER_HOST:="zabbix-server"}
# Default Zabbix server port number
ZBX_SERVER_PORT=${ZBX_SERVER_PORT:-"10051"}
: ${ZBX_SERVER_PORT:="10051"}
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default directories
# User 'zabbix' home directory
ZABBIX_USER_HOME_DIR="/var/lib/zabbix"
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
# Web interface www-root directory
ZBX_FRONTEND_PATH="/usr/share/zabbix"
ZABBIX_WWW_ROOT="/usr/share/zabbix"
# usage: file_env VAR [DEFAULT]
# as example: file_env 'MYSQL_PASSWORD' 'zabbix'
@ -126,7 +127,6 @@ check_db_connect() {
fi
echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}"
echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}"
echo "********************"
fi
echo "********************"
@ -220,8 +220,8 @@ prepare_zbx_web_config() {
export ZBX_SSO_SETTINGS=${ZBX_SSO_SETTINGS:-""}
if [ -n "${ZBX_SESSION_NAME}" ]; then
cp "$ZBX_FRONTEND_PATH/include/defines.inc.php" "/tmp/defines.inc.php_tmp"
sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZBX_FRONTEND_PATH/include/defines.inc.php"
cp "$ZABBIX_WWW_ROOT/include/defines.inc.php" "/tmp/defines.inc.php_tmp"
sed "/ZBX_SESSION_NAME/s/'[^']*'/'${ZBX_SESSION_NAME}'/2" "/tmp/defines.inc.php_tmp" > "$ZABBIX_WWW_ROOT/include/defines.inc.php"
rm -f "/tmp/defines.inc.php_tmp"
fi