Merge pull request #2206 from rrobgill/lighttpd-service-test-cleanup

Lighttpd service test
This commit is contained in:
Mark Drobnak 2018-06-01 22:08:53 -04:00 committed by GitHub
commit e397884e1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2290,13 +2290,11 @@ main() {
if [[ "${INSTALL_WEB_SERVER}" == true ]]; then if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
enable_service lighttpd enable_service lighttpd
fi fi
# Determine if lighttpd is correctly enabled
if [[ -x "$(command -v systemctl)" ]]; then if check_service_active "lighttpd"; then
# Value will either be 1, if true, or 0 LIGHTTPD_ENABLED=true
LIGHTTPD_ENABLED=$(systemctl is-enabled lighttpd | grep -c 'enabled' || true) else
else LIGHTTPD_ENABLED=false
# Value will either be 1, if true, or 0
LIGHTTPD_ENABLED=$(service lighttpd status | awk '/Loaded:/ {print $0}' | grep -c 'enabled' || true)
fi fi
# Install and log everything to a file # Install and log everything to a file
@ -2327,7 +2325,7 @@ main() {
# If the Web server was installed, # If the Web server was installed,
if [[ "${INSTALL_WEB_SERVER}" == true ]]; then if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
if [[ "${LIGHTTPD_ENABLED}" == "1" ]]; then if [[ "${LIGHTTPD_ENABLED}" == true ]]; then
start_service lighttpd start_service lighttpd
enable_service lighttpd enable_service lighttpd
else else