2019-05-01 17:14:28 +02:00
|
|
|
print_config_title 'CHECK SERVICES'
|
2019-03-24 15:56:17 +01:00
|
|
|
|
|
|
|
# Test services status
|
|
|
|
for service in ${SERVICES_TO_CHECK[@]};
|
|
|
|
do
|
|
|
|
echo -e "Check service status : ${BLUE}${service}${NC}"
|
|
|
|
|
|
|
|
# Check if service is started
|
|
|
|
/etc/init.d/${service} status &>/dev/null
|
|
|
|
|
|
|
|
# Return Code
|
|
|
|
RC=$?
|
|
|
|
|
|
|
|
# Service not started or error
|
|
|
|
if [ $RC -ne 0 ]
|
|
|
|
then
|
|
|
|
SERVICES_NOT_STARTED_OR_ERROR="${SERVICES_NOT_STARTED_OR_ERROR} ${service}"
|
|
|
|
echo -e "${RED}Service ${service} NOT STARTED or ERROR : check KO${NC}\n"
|
|
|
|
# Service started without error
|
|
|
|
else
|
|
|
|
echo -e "${GREEN}Service ${service} STARTED : check OK${NC}\n"
|
|
|
|
fi
|
|
|
|
done
|