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

added function to check all dependencies #102

Merged
merged 5 commits into from Oct 10, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

added function to check all dependencies

  • Loading branch information
root
root committed Aug 31, 2017
commit 171dcf96c2fc4dad0ab755661115cf0b96a78d60
@@ -106,16 +106,16 @@ checkLinuxLogglyCompatibility()

#check if the OS is supported by the script. If no, then exit
checkIfSupportedOS

#check if required dependencies to run the script are not installed. If yes, ask user to install them manually and run the script again.
checkIfRequiredDependenciesAreNotInstalled

#check if package-manager is installed
checkIfPackageManagerIsInstalled
#check if package-manager is present on the machine
checkIfPackageManagerIsPresent

#set the basic variables needed by this script
setLinuxVariables

#check if curl is not installed. If yes, ask user to install it manually and run the script again.
checkIfCurlIsNotInstalled

#check if the Loggly servers are accessible. If no, ask user to check network connectivity & exit
checkIfLogglyServersAccessible

@@ -217,8 +217,8 @@ checkIfUserHasRootPrivileges()
fi
}

#check if package-manager is installed
checkIfPackageManagerIsInstalled()
#check if package-manager is present on the machine
checkIfPackageManagerIsPresent()
{
if [ -x "$(command -v apt-get)" ]; then
PKG_MGR="apt-get"
@@ -229,6 +229,18 @@ checkIfPackageManagerIsInstalled()
fi
}

#check if required dependencies to run the script are not installed, If yes then ask user to install them manually and run the script again
checkIfRequiredDependenciesAreNotInstalled()
{
if ! [ -x "$(command -v curl)" ]; then
logMsgToConfigSysLog "ERROR" "ERROR: 'Curl' executable could not be found on your machine, since it is a dependent package to run this script, please install it manually and then run the script again.";
exit 1
elif ! [ -x "$(command -v ping)" ]; then
logMsgToConfigSysLog "ERROR" "ERROR: 'Ping' executable could not be found on your machine, since it is a dependent package to run this script, please install it manually and then run the script again.";
exit 1
fi
}

#check if supported operating system
checkIfSupportedOS()
{
@@ -310,15 +322,6 @@ setLinuxVariables()
LOGGLY_ACCOUNT_URL=https://$LOGGLY_ACCOUNT.loggly.com
}

#check if curl is not installed
checkIfCurlIsNotInstalled()
{
if ! [ -x "$(command -v curl)" ]; then
logMsgToConfigSysLog "ERROR" "ERROR: 'Curl' is not installed on your machine, please install it manually and then run the script again.";
exit 1
fi
}

#checks if all the various endpoints used for configuring loggly are accessible
checkIfLogglyServersAccessible()
{
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.