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 all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -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 unattended mode: no remote tests are run
#and only account and token are required.
UNATTENDED_MODE="false"

#variables used in 22-loggly.conf file
LOGGLY_SYSLOG_PORT=6514
LOGGLY_DISTRIBUTION_ID="41058"
@@ -124,17 +128,22 @@ checkLinuxLogglyCompatibility() {
#set the basic variables needed by this script
setLinuxVariables

#check if the Loggly servers are accessible. If no, ask user to check network connectivity & exit
checkIfLogglyServersAccessible
# in unattended mode, we don't do remote checks
if [ "$UNATTENDED_MODE" != "true" ]; then

#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

#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 ] --unattended [--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
;;
--unattended)
UNATTENDED_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 "$UNATTENDED_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.