echo"Checking if https://www.loggly.com is reachable"
if [ $(curl -s --head --request GET https://www.loggly.com | grep "200 OK"| wc -l)== 1 ];then
echo"INFO: https://www.loggly.com is reachable"
else
logMsgToConfigSysLog "WARNING""WARNING: https://www.loggly.com is not reachable. Please check your network and firewall settings. Continuing to configure Loggly on your system..."
fi
echo"Checking if https://$LOGGLY_ACCOUNT.loggly.com is reachable"
if [ $(curl -s --head --request GET https://$LOGGLY_ACCOUNT.loggly.com/login | grep "200 OK"| wc -l)== 1 ];then
logMsgToConfigSysLog "WARNING""WARNING: https://$LOGGLY_ACCOUNT.loggly.com is not reachable. Please check your network and firewall settings. Continuing to configure Loggly on your system..."
Many of these urls should be defined as variables/constants at the top of the script, instead of being embedded into these functions. Users who care about security will definitely look at this script before they actually execute it. A nicely constructed script that gives clear visibility into what it is doing will automatically win over trust on a user's part. A complex script will do the exact opposite and can increase the chance of it not being used.
echo"INFO: logs-01.loggly.com is reachable"
else
logMsgToConfigSysLog "WARNING""WARNING: logs-01.loggly.com is not reachable. Please check your network and firewall settings. Continuing to configure Loggly on your system..."
logMsgToConfigSysLog "ERROR""ERROR: Tomcat logs did not make to Loggly in stipulated time. Please retry"
logMsgToConfigSysLog "ERROR""ERROR: Tomcat logs did not make to Loggly in stipulated time. Please check your token & network/firewall settings and retry"
echo"Again Fetch: initial count $initialCount : final count : $finalCount counter: $counter max counter: $maxCounter"
let counter=$counter+1
if [ "$counter"-gt"$maxCounter" ];then
logMsgToConfigSysLog "ERROR""ERROR: Tomcat logs did not make to Loggly in stipulated time. Please retry"
logMsgToConfigSysLog "ERROR""ERROR: Tomcat logs did not make to Loggly in stipulated time. Please check your token & network/firewall settings and retry"
usage: ltomcatsetup [-a loggly auth account or subdomain] [-t loggly token] [-u username] [-p password (optional)] [-d to debug (optional)] [-ch catalina home (optional)]
usage: ltomcatsetup [-a loggly auth account or subdomain] [-t loggly token] [-u username] [-p password (optional)] [-ch catalina home (optional)]
usage: ltomcatsetup [-r to rollback] [-ch catalina home (optional)]
usage: ltomcatsetup [-h for help]
EOF
@@ -518,6 +551,9 @@ restartsyslog()
{
echo"Restarting the rsyslog service..."
sudo service rsyslog restart
if [ $?-ne 0 ];then
logMsgToConfigSysLog "WARNING""WARNING: rsyslog did not restart gracefully. Please restart rsyslog manually"
fi
}
restartTomcat()
@@ -528,15 +564,27 @@ restartTomcat()
if [ -f /etc/init.d/$SERVICE ];then
echo"INFO: $SERVICE is running as service"
sudo service $SERVICE restart
if [ $?-ne 0 ];then
logMsgToConfigSysLog "WARNING""WARNING: Tomcat did not restart gracefully. Log rotation may not be disabled. Please restart tomcat manually"
fi
else
echo"INFO: $SERVICE is not running as service..."
# To be commented only for test
echo"INFO: Shutting down tomcat..."
$LOGGLY_CATALINA_HOME/bin/shutdown.sh
echo"INFO: Done shutting down tomcat!"
sudo $LOGGLY_CATALINA_HOME/bin/shutdown.sh
if [ $?-ne 0 ];then
logMsgToConfigSysLog "WARNING""WARNING: Tomcat did not shut down gracefully"
else
echo"INFO: Done shutting down tomcat!"
fi
echo"INFO: Starting up tomcat..."
$LOGGLY_CATALINA_HOME/bin/startup.sh
echo"INFO: Tomcat is up and running"
sudo $LOGGLY_CATALINA_HOME/bin/startup.sh
if [ $?-ne 0 ];then
logMsgToConfigSysLog "WARNING""WARNING: Tomcat did not start up down gracefully"
else
echo"INFO: Tomcat is up and running"
fi
fi
fi
}
@@ -602,9 +650,9 @@ while [ "$1" != "" ]; do
-p | --password ) shift
LOGGLY_PASSWORD=$1
;;
-d | --debug )
LOGGLY_DEBUG="true"
;;
#-d | --debug )
# LOGGLY_DEBUG="true"
# ;;
-r | --rollback )
LOGGLY_ROLLBACK="true"
;;
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products.
Learn more.
We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products.
You can always update your selection by clicking Cookie Preferences at the bottom of the page.
For more information, see our Privacy Statement.
Essential cookies
We use essential cookies to perform essential website functions, e.g. they're used to log you in.
Learn more
Always active
Analytics cookies
We use analytics cookies to understand how you use our websites so we can make them better, e.g. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task.
Learn more
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
Added username/ password verification #60
Added username/ password verification #60
Changes from all commits
1ce8ccc50182b136c4541File filter...
Jump to…
vinhnMay 8, 2014
Many of these urls should be defined as variables/constants at the top of the script, instead of being embedded into these functions. Users who care about security will definitely look at this script before they actually execute it. A nicely constructed script that gives clear visibility into what it is doing will automatically win over trust on a user's part. A complex script will do the exact opposite and can increase the chance of it not being used.
vinhnMay 8, 2014
Ok to send password in clear text over unencrypted connection? Should this be over https instead?
mchaudharyMay 8, 2014
Contributor
Great catch. This should be over https. I will fix it.