fix: daily.sh log_dir failed when install_dir and log_dir were not set

This commit is contained in:
Tony Murray
2016-11-14 16:03:51 -06:00
parent 6d5220ed38
commit a0e33786fa

View File

@@ -20,11 +20,11 @@
# CONSTANTS
#######################################
# define DIR_LIBRENMS as the directory this script is called from
DIR_LIBRENMS=$(dirname "$0");
DIR_LIBRENMS=$(dirname "$(readlink -f "$0")")
# set log_file, using librenms $config['log_dir'], if set
# otherwise we default to <LibreNMS Install Directory>/logs
LOG_DIR=$(php -r "include '${DIR_LIBRENMS}/config.php'; isset(\$config['log_dir']) ? print \$config['log_dir'] : print \$config['install_dir'] . '/logs';");
LOG_DIR=$(php -r "include '${DIR_LIBRENMS}/config.php'; echo isset(\$config['log_dir']) ? \$config['log_dir'] : '${DIR_LIBRENMS}/logs';")
#######################################