From a0e33786faabab2bc13a1623b6aede5ae57164a5 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Mon, 14 Nov 2016 16:03:51 -0600 Subject: [PATCH] fix: daily.sh log_dir failed when install_dir and log_dir were not set --- daily.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daily.sh b/daily.sh index 3dd226ee3f..ae26f7ab03 100755 --- a/daily.sh +++ b/daily.sh @@ -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 /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';") #######################################