#!/bin/bash
KNOWN_PATH="/usr/sbin /sbin /opt/apache2/bin /usr/local/sbin"
HTTPD_DIR=
for path in $KNOWN_PATH; do
echo "trying $path/httpd..."
if `ls $path/httpd > /dev/null 2>&1`; then
HTTPD_DIR=$path
break
fi
done
if [ -z $HTTPD_DIR ]; then
echo "httpd path not found, please enter the path to directory where httpd is"
echo -n "httpd path : "
read HTTPD_DIR
fi
HTTPD="$HTTPD_DIR/httpd"
if [ ! -x $HTTPD ]; then
echo "httpd could not be found, exiting..."
exit 1
fi
$HTTPD -V

Recent Comments