@@ -275,20 +275,20 @@ assumeTomcatHome() {
275275# checks for startup.sh if tomcat is not configured as service
276276checkIfValidTomcatHome ()
277277{
278- # check if logging.properties files is present
279- if [ ! -f " $LOGGLY_CATALINA_HOME /conf/logging.properties" ]; then
280- logMsgToConfigSysLog " WARN" " WARN: Unable to find conf/logging.properties file within $LOGGLY_CATALINA_HOME ."
281- eval $1 =" false"
282- # check if tomcat is configured as a service. If no, then check if we have access to startup.sh file
283- elif [ ! -f /etc/init.d/$SERVICE ]; then
284- if [[ ! $( which systemctl) && $( systemctl list-unit-files $SERVICE .service | grep " $SERVICE .service" ) ]] & > /dev/null; then
285- logMsgToConfigSysLog " INFO" " INFO: Tomcat is not configured as a service."
286- if [ ! -f " $LOGGLY_CATALINA_HOME /bin/startup.sh" ]; then
287- logMsgToConfigSysLog " WARN" " WARN: Unable to find bin/startup.sh file within $LOGGLY_CATALINA_HOME ."
288- eval $1 =" false"
289- fi
290- fi
291- fi
278+ # check if logging.properties files is present
279+ if [ ! -f " $LOGGLY_CATALINA_HOME /conf/logging.properties" ]; then
280+ logMsgToConfigSysLog " WARN" " WARN: Unable to find conf/logging.properties file within $LOGGLY_CATALINA_HOME ."
281+ eval $1 =" false"
282+ # check if tomcat is configured as a service. If no, then check if we have access to startup.sh file
283+ elif [ ! -f /etc/init.d/$SERVICE ]; then
284+ if [[ ! $( which systemctl) && $( systemctl list-unit-files $SERVICE .service | grep " $SERVICE .service" ) ]] & > /dev/null; then
285+ logMsgToConfigSysLog " INFO" " INFO: Tomcat is not configured as a service."
286+ if [ ! -f " $LOGGLY_CATALINA_HOME /bin/startup.sh" ]; then
287+ logMsgToConfigSysLog " WARN" " WARN: Unable to find bin/startup.sh file within $LOGGLY_CATALINA_HOME ."
288+ eval $1 =" false"
289+ fi
290+ fi
291+ fi
292292}
293293
294294# sets tomcat variables which will be used across various functions
@@ -505,14 +505,14 @@ write21TomcatFileContents() {
505505 sudo touch $TOMCAT_SYSLOG_CONFFILE
506506 sudo chmod o+w $TOMCAT_SYSLOG_CONFFILE
507507
508- commonContent="
509- \$ ModLoad imfile
510- \$ WorkDirectory $RSYSLOG_DIR
511- "
512- if [[ " $LINUX_DIST " == * " Ubuntu" * ]]; then
513- commonContent+=" \$ PrivDropToGroup adm
514- "
515- fi
508+ commonContent="
509+ \$ ModLoad imfile
510+ \$ WorkDirectory $RSYSLOG_DIR
511+ "
512+ if [[ " $LINUX_DIST " == * " Ubuntu" * ]]; then
513+ commonContent+=" \$ PrivDropToGroup adm
514+ "
515+ fi
516516
517517 imfileStr=$commonContent "
518518
@@ -549,10 +549,10 @@ if \$programname == 'initd' then @@logs-01.loggly.com:6514;LogglyFormatTomcat
549549if \$ programname == 'initd' then ~
550550"
551551
552- # if log rotation is enabled i.e. tomcat version is greater than or equal to
553- # 6.0.33.0, then add the following lines to tomcat syslog conf file
554- if [ $( compareVersions $TOMCAT_VERSION $MIN_TOMCAT_VERSION 4) -ge 0 ]; then
555- imfileStr+=$commonContent "
552+ # if log rotation is enabled i.e. tomcat version is greater than or equal to
553+ # 6.0.33.0, then add the following lines to tomcat syslog conf file
554+ if [ $( compareVersions $TOMCAT_VERSION $MIN_TOMCAT_VERSION 4) -ge 0 ]; then
555+ imfileStr+=$commonContent "
556556# catalina.log
557557\$ InputFileName $LOGGLY_CATALINA_LOG_HOME /catalina.log
558558\$ InputFileTag catalina-log
@@ -605,7 +605,7 @@ if \$programname == 'tomcat-access' then ~
605605"
606606 fi
607607
608- imfileStrNonTls=$commonContent "
608+ imfileStrNonTls=$commonContent "
609609
610610#parameterized token here.......
611611#Add a tag for tomcat events
@@ -632,10 +632,10 @@ if \$programname == 'initd' then @@logs-01.loggly.com:514;LogglyFormatTomcat
632632if \$ programname == 'initd' then ~
633633"
634634
635- # if log rotation is enabled i.e. tomcat version is greater than or equal to
636- # 6.0.33.0, then add the following lines to tomcat syslog conf file
637- if [ $( compareVersions $TOMCAT_VERSION $MIN_TOMCAT_VERSION 4) -ge 0 ]; then
638- imfileStrNonTls+=$commonContent "
635+ # if log rotation is enabled i.e. tomcat version is greater than or equal to
636+ # 6.0.33.0, then add the following lines to tomcat syslog conf file
637+ if [ $( compareVersions $TOMCAT_VERSION $MIN_TOMCAT_VERSION 4) -ge 0 ]; then
638+ imfileStrNonTls+=$commonContent "
639639# catalina.log
640640\$ InputFileName $LOGGLY_CATALINA_LOG_HOME /catalina.log
641641\$ InputFileTag catalina-log
@@ -689,9 +689,9 @@ if \$programname == 'tomcat-access' then ~
689689 fi
690690
691691 if [ $TLS_SENDING == " false" ];
692- then
693- imfileStr=$imfileStrNonTls
694- fi
692+ then
693+ imfileStr=$imfileStrNonTls
694+ fi
695695
696696 # change the tomcat-21 file to variable from above and also take the directory of the tomcat log file.
697697 sudo cat << EOIPFW >>$TOMCAT_SYSLOG_CONFFILE
@@ -846,24 +846,24 @@ else
846846 LOGGLY_USERNAME=$1
847847 echo " Username is set"
848848 ;;
849- -p | --password ) shift
850- LOGGLY_PASSWORD=$1
851- ;;
852- -tag| --filetag ) shift
853- LOGGLY_FILE_TAG=$1
854- echo " File tag: $LOGGLY_FILE_TAG "
855- ;;
849+ -p | --password ) shift
850+ LOGGLY_PASSWORD=$1
851+ ;;
852+ -tag | --filetag ) shift
853+ LOGGLY_FILE_TAG=$1
854+ echo " File tag: $LOGGLY_FILE_TAG "
855+ ;;
856856 -r | --rollback )
857- LOGGLY_ROLLBACK=" true"
857+ LOGGLY_ROLLBACK=" true"
858858 ;;
859859 -s | --suppress )
860- SUPPRESS_PROMPT=" true"
861- ;;
860+ SUPPRESS_PROMPT=" true"
861+ ;;
862862 --insecure )
863- LOGGLY_TLS_SENDING=" false"
864- TLS_SENDING=" false"
865- LOGGLY_SYSLOG_PORT=514
866- ;;
863+ LOGGLY_TLS_SENDING=" false"
864+ TLS_SENDING=" false"
865+ LOGGLY_SYSLOG_PORT=514
866+ ;;
867867 -h | --help)
868868 usage
869869 exit
0 commit comments