get_apache2_info.sh: add apache version.

This commit is contained in:
Christoph 2021-02-13 03:23:56 +01:00
parent 9cec92749c
commit deb8e5c496

View File

@ -242,6 +242,15 @@ else
fi
echononl "Determin Apache2 version number.."
APACHE_VERSION="$(trim $($HTTPD_COMMAND -v | head -1 | cut -d ":" -f2))"
if [[ $? -gt 0 ]]; then
echo_failed
else
echo_done
fi
echononl "Determin ServerRoot Directory.."
APACHE_SERVER_ROOT="$($_httpd_binary -t -D DUMP_RUN_CFG | grep ServerRoot | awk '{print$2}' | tr -d '"')"
if [[ $? -gt 0 ]]; then
@ -264,12 +273,16 @@ else
fi
echononl "Determin Apache2 version number.."
APACHE_VERSION="$(trim $($HTTPD_COMMAND -v | head -1 | cut -d ":" -f2))"
if [[ $? -gt 0 ]]; then
echo_failed
else
echononl "Determin VHost directory.."
if [[ -d "${APACHE_SERVER_ROOT}/sites-enabled" ]]; then
APACHE_VHOST_DIR="${APACHE_SERVER_ROOT}/sites-enabled"
elif [[ -d "${APACHE_SERVER_ROOT}/conf/vhosts" ]]; then
APACHE_VHOST_DIR="${APACHE_SERVER_ROOT}/conf/vhosts"
fi
if [[ -n "${APACHE_VHOST_DIR}" ]] ; then
echo_done
else
echo_failed
fi
@ -279,38 +292,44 @@ if $terminal ; then
echo -e "\033[4G\033[33m\033[1mApache2 Info:\033[m"
echo -e "\033[4G\033[33m\033[1m=============\033[m"
echo ""
fi
if [[ -n $APACHE_VERSION ]]; then
echo -e "\033[4GApache2 version..................: $APACHE_VERSION"
else
echo -e "\033[4GApache2 version..................: \033[33m-- could not be determined --\033[m"
fi
echo ""
if [[ -x "$HTTPD_COMMAND" ]] ; then
echo -e "\033[4GApache2 daemon ..................: $HTTPD_COMMAND"
else
echo -e "\033[4GApache2 daemon ..................: \033[33m-- could not be determined --\033[m"
fi
echo ""
if [[ -n "$APACHE_SERVER_ROOT" ]] ; then
echo -e "\033[4GServer Root Directory............: $APACHE_SERVER_ROOT"
else
echo "\033[4GServer Root Directory............: \033[33m-- could not be determined --\033[m"
fi
echo ""
if [[ -n "$HTTP_USER" ]] ; then
echo -e "\033[4GApache2 User.....................: $HTTP_USER"
else
echo -e "\033[4GApache2 User.....................: \033[33m-- could not be determined --\033[m"
fi
if [[ -n "$HTTP_GROUP" ]] ; then
echo -e "\033[4GApache2 Group....................: $HTTP_GROUP"
else
echo -e "\033[4GApache2 Group....................: \033[33m-- could not be determined --\033[m"
fi
if [[ -n $APACHE_VERSION ]]; then
echo -e "\033[4GApache2 version..................: $APACHE_VERSION"
else
echo -e "\033[4GApache2 version..................: \033[33m-- could not be determined --\033[m"
fi
echo ""
if [[ -n "$APACHE_SERVER_ROOT" ]] ; then
echo -e "\033[4GServer Root Directory............: $APACHE_SERVER_ROOT"
else
echo "\033[4GServer Root Directory............: \033[33m-- could not be determined --\033[m"
fi
echo ""
if [[ -x "$HTTPD_COMMAND" ]] ; then
echo -e "\033[4GApache2 daemon ..................: $HTTPD_COMMAND"
else
echo -e "\033[4GApache2 daemon ..................: \033[33m-- could not be determined --\033[m"
fi
echo ""
if [[ -n "${APACHE_VHOST_DIR}" ]] ; then
echo -e "\033[4GApache2 VHost directory..........: $APACHE_VHOST_DIR"
else
echo -e "\033[4GApache2 VHost directory..........: \033[33m-- could not be determined --\033[m"
fi
echo ""
if [[ -n "$HTTP_USER" ]] ; then
echo -e "\033[4GApache2 User.....................: $HTTP_USER"
else
echo -e "\033[4GApache2 User.....................: \033[33m-- could not be determined --\033[m"
fi
if [[ -n "$HTTP_GROUP" ]] ; then
echo -e "\033[4GApache2 Group....................: $HTTP_GROUP"
else
echo -e "\033[4GApache2 Group....................: \033[33m-- could not be determined --\033[m"
fi
fi