From 1488743e63007278b233d71415a64df0854c9212 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 24 Apr 2024 16:44:22 +0200 Subject: [PATCH] create_vhost.sh: change how determin httpd binary. --- create_vhost.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/create_vhost.sh b/create_vhost.sh index 577425f..e2a05fd 100755 --- a/create_vhost.sh +++ b/create_vhost.sh @@ -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