Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix indentation to 2 spaces of tomcat script #110

Merged
merged 1 commit into from Nov 21, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

fix indentation to 2 spaces

  • Loading branch information
Shweta Jain
Shweta Jain committed Nov 6, 2017
commit 4dd47010bdfcb80496d88cabe2b93e10e9ffc010
@@ -275,20 +275,20 @@ assumeTomcatHome() {
#checks for startup.sh if tomcat is not configured as service
checkIfValidTomcatHome()
{
#check if logging.properties files is present
if [ ! -f "$LOGGLY_CATALINA_HOME/conf/logging.properties" ]; then
logMsgToConfigSysLog "WARN" "WARN: Unable to find conf/logging.properties file within $LOGGLY_CATALINA_HOME."
eval $1="false"
#check if tomcat is configured as a service. If no, then check if we have access to startup.sh file
elif [ ! -f /etc/init.d/$SERVICE ]; then
if [[ ! $(which systemctl) && $(systemctl list-unit-files $SERVICE.service | grep "$SERVICE.service") ]] &>/dev/null; then
logMsgToConfigSysLog "INFO" "INFO: Tomcat is not configured as a service."
if [ ! -f "$LOGGLY_CATALINA_HOME/bin/startup.sh" ]; then
logMsgToConfigSysLog "WARN" "WARN: Unable to find bin/startup.sh file within $LOGGLY_CATALINA_HOME."
eval $1="false"
fi
fi
fi
#check if logging.properties files is present
if [ ! -f "$LOGGLY_CATALINA_HOME/conf/logging.properties" ]; then
logMsgToConfigSysLog "WARN" "WARN: Unable to find conf/logging.properties file within $LOGGLY_CATALINA_HOME."
eval $1="false"
#check if tomcat is configured as a service. If no, then check if we have access to startup.sh file
elif [ ! -f /etc/init.d/$SERVICE ]; then
if [[ ! $(which systemctl) && $(systemctl list-unit-files $SERVICE.service | grep "$SERVICE.service") ]] &>/dev/null; then
logMsgToConfigSysLog "INFO" "INFO: Tomcat is not configured as a service."
if [ ! -f "$LOGGLY_CATALINA_HOME/bin/startup.sh" ]; then
logMsgToConfigSysLog "WARN" "WARN: Unable to find bin/startup.sh file within $LOGGLY_CATALINA_HOME."
eval $1="false"
fi
fi
fi
}

#sets tomcat variables which will be used across various functions
@@ -505,14 +505,14 @@ write21TomcatFileContents() {
sudo touch $TOMCAT_SYSLOG_CONFFILE
sudo chmod o+w $TOMCAT_SYSLOG_CONFFILE

commonContent="
\$ModLoad imfile
\$WorkDirectory $RSYSLOG_DIR
"
if [[ "$LINUX_DIST" == *"Ubuntu"* ]]; then
commonContent+="\$PrivDropToGroup adm
"
fi
commonContent="
\$ModLoad imfile
\$WorkDirectory $RSYSLOG_DIR
"
if [[ "$LINUX_DIST" == *"Ubuntu"* ]]; then
commonContent+="\$PrivDropToGroup adm
"
fi

imfileStr=$commonContent"
@@ -549,10 +549,10 @@ if \$programname == 'initd' then @@logs-01.loggly.com:6514;LogglyFormatTomcat
if \$programname == 'initd' then ~
"

#if log rotation is enabled i.e. tomcat version is greater than or equal to
#6.0.33.0, then add the following lines to tomcat syslog conf file
if [ $(compareVersions $TOMCAT_VERSION $MIN_TOMCAT_VERSION 4) -ge 0 ]; then
imfileStr+=$commonContent"
#if log rotation is enabled i.e. tomcat version is greater than or equal to
#6.0.33.0, then add the following lines to tomcat syslog conf file
if [ $(compareVersions $TOMCAT_VERSION $MIN_TOMCAT_VERSION 4) -ge 0 ]; then
imfileStr+=$commonContent"
# catalina.log
\$InputFileName $LOGGLY_CATALINA_LOG_HOME/catalina.log
\$InputFileTag catalina-log
@@ -605,7 +605,7 @@ if \$programname == 'tomcat-access' then ~
"
fi

imfileStrNonTls=$commonContent"
imfileStrNonTls=$commonContent"
#parameterized token here.......
#Add a tag for tomcat events
@@ -632,10 +632,10 @@ if \$programname == 'initd' then @@logs-01.loggly.com:514;LogglyFormatTomcat
if \$programname == 'initd' then ~
"

#if log rotation is enabled i.e. tomcat version is greater than or equal to
#6.0.33.0, then add the following lines to tomcat syslog conf file
if [ $(compareVersions $TOMCAT_VERSION $MIN_TOMCAT_VERSION 4) -ge 0 ]; then
imfileStrNonTls+=$commonContent"
#if log rotation is enabled i.e. tomcat version is greater than or equal to
#6.0.33.0, then add the following lines to tomcat syslog conf file
if [ $(compareVersions $TOMCAT_VERSION $MIN_TOMCAT_VERSION 4) -ge 0 ]; then
imfileStrNonTls+=$commonContent"
# catalina.log
\$InputFileName $LOGGLY_CATALINA_LOG_HOME/catalina.log
\$InputFileTag catalina-log
@@ -689,9 +689,9 @@ if \$programname == 'tomcat-access' then ~
fi

if [ $TLS_SENDING == "false" ];
then
imfileStr=$imfileStrNonTls
fi
then
imfileStr=$imfileStrNonTls
fi

#change the tomcat-21 file to variable from above and also take the directory of the tomcat log file.
sudo cat <<EOIPFW >>$TOMCAT_SYSLOG_CONFFILE
@@ -846,24 +846,24 @@ else
LOGGLY_USERNAME=$1
echo "Username is set"
;;
-p | --password ) shift
LOGGLY_PASSWORD=$1
;;
-tag| --filetag ) shift
LOGGLY_FILE_TAG=$1
echo "File tag: $LOGGLY_FILE_TAG"
;;
-p | --password ) shift
LOGGLY_PASSWORD=$1
;;
-tag | --filetag ) shift
LOGGLY_FILE_TAG=$1
echo "File tag: $LOGGLY_FILE_TAG"
;;
-r | --rollback )
LOGGLY_ROLLBACK="true"
LOGGLY_ROLLBACK="true"
;;
-s | --suppress )
SUPPRESS_PROMPT="true"
;;
SUPPRESS_PROMPT="true"
;;
--insecure )
LOGGLY_TLS_SENDING="false"
TLS_SENDING="false"
LOGGLY_SYSLOG_PORT=514
;;
LOGGLY_TLS_SENDING="false"
TLS_SENDING="false"
LOGGLY_SYSLOG_PORT=514
;;
-h | --help)
usage
exit
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.