diff --git a/fragments/arguments.sh b/fragments/arguments.sh index 6c01519..ea6e9db 100644 --- a/fragments/arguments.sh +++ b/fragments/arguments.sh @@ -43,12 +43,14 @@ if [[ $label == "version" ]]; then exit 0 fi -printlog "################## Start Installomator v. $VERSION" -printlog "################## $label" +printlog "################## Start Installomator" REQ +printlog "################## Version: $VERSION" REQ +printlog "################## Date: $VERSIONDATE" REQ +printlog "################## $label" REQ # Check for DEBUG mode if [[ $DEBUG -gt 0 ]]; then - printlog "DEBUG mode $DEBUG enabled." + printlog "DEBUG mode $DEBUG enabled." DEBUG fi # How we get version number from app diff --git a/fragments/functions.sh b/fragments/functions.sh index fdbd066..5e0ea55 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -112,10 +112,10 @@ printlog(){ # Once we finally stop getting duplicate logs output the number of times we got a duplicate. if [[ $logrepeat -gt 1 ]];then - echo "$timestamp" : "${log_priority} : ${VERSIONDATE//-/} : Last Log repeated ${logrepeat} times" | tee -a $log_location + echo "$timestamp" : "${log_priority} : Last Log repeated ${logrepeat} times" | tee -a $log_location if [[ ! -z $datadogAPI ]]; then - curl -s -X POST https://http-intake.logs.datadoghq.com/v1/input -H "Content-Type: text/plain" -H "DD-API-KEY: $datadogAPI" -d "${log_priority} : $mdmURL : $APPLICATION : $VERSIONDATE : $SESSION : Last Log repeated ${logrepeat} times" > /dev/null + curl -s -X POST https://http-intake.logs.datadoghq.com/v1/input -H "Content-Type: text/plain" -H "DD-API-KEY: $datadogAPI" -d "${log_priority} : $mdmURL : $APPLICATION : $VERSION : $SESSION : Last Log repeated ${logrepeat} times" > /dev/null fi logrepeat=0 fi @@ -132,18 +132,12 @@ printlog(){ if [[ ${levels[$log_priority]} -ge ${levels[$LOGGING]} ]]; then while IFS= read -r logmessage; do if [[ "$(whoami)" == "root" ]]; then - echo "$timestamp" : "${log_priority} : ${VERSIONDATE//-/} : ${logmessage}" | tee -a $log_location + echo "$timestamp" : "${log_priority} : ${logmessage}" | tee -a $log_location else - echo "$timestamp" : "${log_priority} : ${VERSIONDATE//-/} : ${logmessage}" + echo "$timestamp" : "${log_priority} : ${logmessage}" fi done <<< "$log_message" fi - -# if [[ "$(whoami)" == "root" ]]; then -# echo "$timestamp" "$label" "$1" | tee -a $log_location -# else -# echo "$timestamp" "$label" "$1" -# fi } # Used to remove dupplicate lines in large log output, for example from msupdate command