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

Add systemctl command to check for nginx service #101

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Add systemctl command to check for nginx service

  • Loading branch information
Cloud User
Cloud User committed Aug 22, 2017
commit fc3bb11c9cd68110423a548130e62894bb0babaa
@@ -115,10 +115,14 @@ removeLogglyConfForNginx()
checkNginxDetails()
{
#verify if nginx is installed as service
if [ ! -f /etc/init.d/$SERVICE ]; then
logMsgToConfigSysLog "ERROR" "ERROR: Nginx is not configured as a service"
exit 1
fi
if [ -f /etc/init.d/$SERVICE ]; then
logMsgToConfigSysLog "INFO" "INFO: Nginx is present as a service."
elif [[ $(which systemctl) && $(systemctl list-unit-files $SERVICE.service | grep "$SERVICE.service") ]] &>/dev/null; then
logMsgToConfigSysLog "INFO" "INFO: Nginx is present as a service."
else
logMsgToConfigSysLog "ERROR" "ERROR: Nginx is not configured as a service"
exit 1
fi

#get the version of nginx installed
getNginxVersion
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.