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

LOG-1498: Add batch-mode. #108

Open
wants to merge 3 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Add batch-mode. auth token is trusted, account is gen2, no delivery …

…tests, no prompts.
  • Loading branch information
Kristján Valur Jónsson
Kristján Valur Jónsson committed Nov 2, 2017
commit 93c918061d301935a19f2dd9c93225f206fbd9ba
@@ -75,6 +75,10 @@ LOGGLY_PASSWORD=
#if this variable is set to true then suppress all prompts
SUPPRESS_PROMPT="false"

#if this variable is "true", we are in batch mode: no remote tests are run
#and only account and token are required.
BATCH_MODE="false"

#variables used in 22-loggly.conf file
LOGGLY_SYSLOG_PORT=6514
LOGGLY_DISTRIBUTION_ID="41058"
@@ -127,14 +131,19 @@ checkLinuxLogglyCompatibility() {
#check if the Loggly servers are accessible. If no, ask user to check network connectivity & exit
checkIfLogglyServersAccessible

#check if user credentials are valid. If no, then exit
checkIfValidUserNamePassword
#if we have username and password, check and verify account
if [ "$LOGGLY_USERNAME" != "" -a "$LOGGLY_PASSWORD" != "" ]; then

#check if user credentials are valid. If no, then exit
checkIfValidUserNamePassword

#get authentication token if not provided
getAuthToken
#get authentication token if not provided
getAuthToken

#check if authentication token is valid. If no, then exit.
checkIfValidAuthToken
#check if authentication token is valid. If no, then exit.
checkIfValidAuthToken

fi

#checking if syslog-ng is configured as a service
checkifSyslogNgConfiguredAsService
@@ -987,6 +996,7 @@ checkScriptRunningMode() {
usage() {
cat <<EOF
usage: configure-linux [-a loggly auth account or subdomain] [-t loggly token (optional)] [-u username] [-p password (optional)] [-s suppress prompts {optional)] [--insecure {to send logs without TLS} (optional)[--force-secure {optional} ]
usage: configure-linux [-a loggly auth account or subdomain] [-t loggly token ] --batch [--insecure {to send logs without TLS} (optional)[--force-secure {optional} ]
usage: configure-linux [-a loggly auth account or subdomain] [-r to remove]
usage: configure-linux [-h for help]
EOF
@@ -1035,6 +1045,11 @@ if [ "$1" != "being-invoked" ]; then
LOGGLY_TLS_SENDING="true"
LOGGLY_SYSLOG_PORT=6514
;;
--batch)
BATCH_MODE="true"
LINUX_DO_VERIFICATION="false"
SUPPRESS_PROMPT="true"
;;
-h | --help)
usage
exit
@@ -1055,6 +1070,8 @@ if [ "$1" != "being-invoked" ]; then
getPassword
fi
installLogglyConf
elif [ "$LOGGLY_ACCOUNT" != "" -a "$BATCH_MODE" == "true" ]; then
installLogglyConf
else
usage
fi
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.