From 76fe5e06c75d10058201c7a724e9ffef4d44e44c Mon Sep 17 00:00:00 2001 From: psquickitjayant Date: Mon, 19 May 2014 18:27:56 +0530 Subject: [PATCH] Fixed logging for Mac --- ltomcatsetup.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ltomcatsetup.sh b/ltomcatsetup.sh index 68ae472..652348d 100755 --- a/ltomcatsetup.sh +++ b/ltomcatsetup.sh @@ -685,7 +685,15 @@ logMsgToConfigSysLog() echo "$2" currentTime=$(date) - enabler=$(echo MWVjNGU4ZTEtZmJiMi00N2U3LTkyOWItNzVhMWJmZjVmZmUw | base64 -d) + #for Linux system, we need to use -d switch to decode base64 whereas + #for Mac system, we need to use -D switch to decode + varUname=$(uname) + if [[ $varUname == 'Linux' ]]; then + enabler=$(echo MWVjNGU4ZTEtZmJiMi00N2U3LTkyOWItNzVhMWJmZjVmZmUw | base64 -d) + elif [[ $varUname == 'Darwin' ]]; then + enabler=$(echo MWVjNGU4ZTEtZmJiMi00N2U3LTkyOWItNzVhMWJmZjVmZmUw | base64 -D) + fi + if [ $? -ne 0 ]; then echo "ERROR: Base64 decode is not supported on your Operating System. Please update your system to support Base64" exit 1