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

Rename to "unattended". Also skip server ping

  • Loading branch information
Kristján Valur Jónsson
Kristján Valur Jónsson committed Nov 3, 2017
commit 68928381a6e946a5aacc5a06e15e51619a44f1bc
@@ -75,9 +75,9 @@ 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
#if this variable is "true", we are in unattended mode: no remote tests are run
#and only account and token are required.
BATCH_MODE="false"
UNATTENDED_MODE="false"

#variables used in 22-loggly.conf file
LOGGLY_SYSLOG_PORT=6514
@@ -128,12 +128,12 @@ 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

#if we have username and password, check and verify account
if [ "$LOGGLY_USERNAME" != "" -a "$LOGGLY_PASSWORD" != "" ]; then

# in unattended mode, we don't do remote checks
fi [ "$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

@@ -996,7 +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] [-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
@@ -1045,8 +1045,8 @@ if [ "$1" != "being-invoked" ]; then
LOGGLY_TLS_SENDING="true"
LOGGLY_SYSLOG_PORT=6514
;;
--batch)
BATCH_MODE="true"
--unattended)
UNATTENDED_MODE="true"
LINUX_DO_VERIFICATION="false"
SUPPRESS_PROMPT="true"
;;
@@ -1070,7 +1070,7 @@ if [ "$1" != "being-invoked" ]; then
getPassword
fi
installLogglyConf
elif [ "$LOGGLY_ACCOUNT" != "" -a "$BATCH_MODE" == "true" ]; then
elif [ "$LOGGLY_ACCOUNT" != "" -a "$UNATTENDED_MODE" == "true" ]; then
installLogglyConf
else
usage
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.