#!/bin/bash
set -eu

RC=0
fail () {
	echo "FAIL: $@" >&2
	RC=1
}

declare -a REQUIRED_MODS
REQUIRED_MODS=(
	alias
	auth_basic
	authn_core
	authz_core
	log_config
	mime
	reqtimeout
	version
	watchdog
)


for m in "${REQUIRED_MODS[@]}" ; do
	apachectl -M | grep -w "${m}_module" || fail "Module $m not activated"
done

exit $RC
