create_vhost.sh: change how determin httpd binary.

This commit is contained in:
Christoph 2024-04-24 16:44:22 +02:00
parent 068c241353
commit 1488743e63

View File

@ -207,14 +207,25 @@ shopt -u extglob
# - Determin httpd binary
# -
_httpd_binary="`which httpd`"
## - Determin httpd binary
## -
_httpd_binary="$(ps -axu | grep httpd \
| grep -e "^root" \
| grep -v grep \
| grep -v vim \
| grep -v bash \
| awk '{print$11}' | head -1)"
if [ -z "$_httpd_binary" ]; then
_httpd_binary="$(ps -axu | grep httpd | grep -e "^root" | grep -v grep | awk '{print$11}')"
_httpd_binary="$(which httpd)"
if [ -z "$_httpd_binary" ]; then
if [ -x "/usr/local/apache2/bin/httpd" ]; then
_httpd_binary="/usr/local/apache2/bin/httpd"
fi
fi
fi
# - Determin websever user/group