create_summary_websites.sh: Add support for PHP version 8.3; Many changes in script output.

This commit is contained in:
Christoph 2023-12-24 02:49:51 +01:00
parent 98b9cfb4ed
commit 80df4e6dfc

View File

@ -12,7 +12,7 @@ declare -a apache_vhost_dir_arr
declare -a _all_vhost_files_arr declare -a _all_vhost_files_arr
declare -a _all_document_root_dirs_arr declare -a _all_document_root_dirs_arr
PHP_VERIONS_SUPPORTED="5.3 5.4 5.5 5.6 7.0.7.1 7.2 7.3 7.4 8.0 8.1 8.2" PHP_VERIONS_SUPPORTED="5.3 5.4 5.5 5.6 7.0.7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3"
declare -i number_websites_53=0 declare -i number_websites_53=0
declare -i number_websites_54=0 declare -i number_websites_54=0
@ -26,6 +26,7 @@ declare -i number_websites_74=0
declare -i number_websites_80=0 declare -i number_websites_80=0
declare -i number_websites_81=0 declare -i number_websites_81=0
declare -i number_websites_82=0 declare -i number_websites_82=0
declare -i number_websites_83=0
declare -i number_redirected=0 declare -i number_redirected=0
declare -i number_parked=0 declare -i number_parked=0
declare -i number_mod_php=0 declare -i number_mod_php=0
@ -61,6 +62,7 @@ clean_up() {
rm -f $_tmp_filename_php_80 rm -f $_tmp_filename_php_80
rm -f $_tmp_filename_php_81 rm -f $_tmp_filename_php_81
rm -f $_tmp_filename_php_82 rm -f $_tmp_filename_php_82
rm -f $_tmp_filename_php_83
rm -f $_tmp_filename_not_considered rm -f $_tmp_filename_not_considered
rm -f $_tmp_filename_no_php_assigned rm -f $_tmp_filename_no_php_assigned
exit $1 exit $1
@ -112,29 +114,27 @@ if [[ -f "$conf_file" ]]; then
fi fi
if [[ -z "$DST_PATH_PHP" ]]; then if [[ -z "$WEB_DOCROOT" ]]; then
if [[ -d "/var/www/html/dummy/htdocs" ]] ; then fatal "Missing value for variable 'WEB_DOCROOT'!"
DST_PATH_PHP="/var/www/html/dummy/htdocs" fi
elif [[ -d "/var/www/html/dummy" ]] ; then
DST_PATH_PHP="/var/www/html/dummy" if [[ -z "$DST_PATH_STATS" ]]; then
elif [[ -d "/var/www/default" ]] ; then DST_PATH_STATS="${WEB_DOCROOT}/website-stats"
DST_PATH_PHP="$DST_PATH_PHP" fi
fi
else if [[ ! -d "$DST_PATH_STATS" ]]; then
if [[ ! -d "$DST_PATH_PHP" ]]; then mkdir "$DST_PATH_STATS" > /dev/null 2>&1
mkdir "$DST_PATH_PHP" > /dev/null 2>&1 if [[ $? -ne 0 ]]; then
if [[ $? -ne 0 ]]; then fatal "Creation of directory '$DST_PATH_STATS' failed!"
fatal "Creation of directory '$DST_PATH_PHP' failed!"
fi
fi fi
fi fi
if [[ -z "$DST_PATH_PHP" ]]; then if [[ -z "$DST_PATH_STATS" ]]; then
fatal "Destination Path for statistics (parameter 'DST_PATH_PHP') not found!" fatal "Destination Path for statistics (parameter 'DST_PATH_STATS') not found!"
fi fi
if [[ -z "$DST_DIR_CSV" ]] ; then if [[ -z "$DST_DIR_CSV" ]] ; then
DST_DIR_CSV="${DST_PATH_PHP}/csv-files-website-stats" DST_DIR_CSV="${DST_PATH_STATS}/csv-files-website-stats"
fi fi
if [[ ! -d "$DST_DIR_CSV" ]]; then if [[ ! -d "$DST_DIR_CSV" ]]; then
@ -144,9 +144,13 @@ if [[ ! -d "$DST_DIR_CSV" ]]; then
fi fi
fi fi
if [[ -z "${WEB_DIR_CSV}" ]]; then
WEB_DIR_CSV="/website-stats/csv-files-website-stats"
fi
_tmp_filename_summary=$(mktemp) _tmp_filename_summary=$(mktemp)
filename_summary="${DST_DIR_CSV}/WEBSITES_SUMMARY.csv" filename_summary="${DST_DIR_CSV}/WEBSITES_SUMMARY.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_summary.php cat <<EOF > ${DST_PATH_STATS}/websites_summary.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_summary)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_summary)\"");
@ -160,7 +164,7 @@ echo ";" >> $filename_summary
_tmp_filename_redirected=$(mktemp) _tmp_filename_redirected=$(mktemp)
filename_redirected="${DST_DIR_CSV}/WEBSITES_REDIRECTED.csv" filename_redirected="${DST_DIR_CSV}/WEBSITES_REDIRECTED.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_redirected.php cat <<EOF > ${DST_PATH_STATS}/websites_redirected.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_redirected)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_redirected)\"");
@ -174,7 +178,7 @@ echo ";" >> $filename_redirected
_tmp_filename_parked=$(mktemp) _tmp_filename_parked=$(mktemp)
filename_parked="${DST_DIR_CSV}/WEBSITES_PARKED.csv" filename_parked="${DST_DIR_CSV}/WEBSITES_PARKED.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_parked.php cat <<EOF > ${DST_PATH_STATS}/websites_parked.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_parked)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_parked)\"");
@ -188,7 +192,7 @@ echo ";" >> $filename_parked
_tmp_filename_mod_php=$(mktemp) _tmp_filename_mod_php=$(mktemp)
filename_mod_php="${DST_DIR_CSV}/WEBSITES_MOD_PHP.csv" filename_mod_php="${DST_DIR_CSV}/WEBSITES_MOD_PHP.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_mod_php.php cat <<EOF > ${DST_PATH_STATS}/websites_mod_php.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_mod_php)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_mod_php)\"");
@ -202,7 +206,7 @@ echo ";" >> $filename_mod_php
_tmp_filename_php_fpm=$(mktemp) _tmp_filename_php_fpm=$(mktemp)
filename_php_fpm="${DST_DIR_CSV}/WEBSITES_PHP_FPM.csv" filename_php_fpm="${DST_DIR_CSV}/WEBSITES_PHP_FPM.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_fpm.php cat <<EOF > ${DST_PATH_STATS}/websites_php_fpm.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_fpm)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_fpm)\"");
@ -216,7 +220,7 @@ echo ";" >> $filename_php_fpm
_tmp_filename_php_fcgid=$(mktemp) _tmp_filename_php_fcgid=$(mktemp)
filename_php_fcgid="${DST_DIR_CSV}/WEBSITES_PHP_FCGID.csv" filename_php_fcgid="${DST_DIR_CSV}/WEBSITES_PHP_FCGID.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_fcgid.php cat <<EOF > ${DST_PATH_STATS}/websites_php_fcgid.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_fcgid)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_fcgid)\"");
@ -230,7 +234,7 @@ echo ";" >> $filename_php_fcgid
_tmp_filename_php_53=$(mktemp) _tmp_filename_php_53=$(mktemp)
filename_php_53="${DST_DIR_CSV}/WEBSITES_PHP_53.csv" filename_php_53="${DST_DIR_CSV}/WEBSITES_PHP_53.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_53.php cat <<EOF > ${DST_PATH_STATS}/websites_php_53.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_53)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_53)\"");
@ -244,7 +248,7 @@ echo ";" >> $filename_php_53
_tmp_filename_php_54=$(mktemp) _tmp_filename_php_54=$(mktemp)
filename_php_54="${DST_DIR_CSV}/WEBSITES_PHP_54.csv" filename_php_54="${DST_DIR_CSV}/WEBSITES_PHP_54.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_54.php cat <<EOF > ${DST_PATH_STATS}/websites_php_54.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_54)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_54)\"");
@ -258,7 +262,7 @@ echo ";" >> $filename_php_54
_tmp_filename_php_55=$(mktemp) _tmp_filename_php_55=$(mktemp)
filename_php_55="${DST_DIR_CSV}/WEBSITES_PHP_55.csv" filename_php_55="${DST_DIR_CSV}/WEBSITES_PHP_55.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_55.php cat <<EOF > ${DST_PATH_STATS}/websites_php_55.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_55)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_55)\"");
@ -272,7 +276,7 @@ echo ";" >> $filename_php_55
_tmp_filename_php_56=$(mktemp) _tmp_filename_php_56=$(mktemp)
filename_php_56="${DST_DIR_CSV}/WEBSITES_PHP_56.csv" filename_php_56="${DST_DIR_CSV}/WEBSITES_PHP_56.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_56.php cat <<EOF > ${DST_PATH_STATS}/websites_php_56.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_56)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_56)\"");
@ -286,7 +290,7 @@ echo ";" >> $filename_php_56
_tmp_filename_php_70=$(mktemp) _tmp_filename_php_70=$(mktemp)
filename_php_70="${DST_DIR_CSV}/WEBSITES_PHP_70.csv" filename_php_70="${DST_DIR_CSV}/WEBSITES_PHP_70.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_70.php cat <<EOF > ${DST_PATH_STATS}/websites_php_70.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_70)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_70)\"");
@ -300,7 +304,7 @@ echo ";" >> $filename_php_70
_tmp_filename_php_71=$(mktemp) _tmp_filename_php_71=$(mktemp)
filename_php_71="${DST_DIR_CSV}/WEBSITES_PHP_71.csv" filename_php_71="${DST_DIR_CSV}/WEBSITES_PHP_71.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_71.php cat <<EOF > ${DST_PATH_STATS}/websites_php_71.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_71)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_71)\"");
@ -314,7 +318,7 @@ echo ";" >> $filename_php_71
_tmp_filename_php_72=$(mktemp) _tmp_filename_php_72=$(mktemp)
filename_php_72="${DST_DIR_CSV}/WEBSITES_PHP_72.csv" filename_php_72="${DST_DIR_CSV}/WEBSITES_PHP_72.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_72.php cat <<EOF > ${DST_PATH_STATS}/websites_php_72.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_72)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_72)\"");
@ -328,7 +332,7 @@ echo ";" >> $filename_php_72
_tmp_filename_php_73=$(mktemp) _tmp_filename_php_73=$(mktemp)
filename_php_73="${DST_DIR_CSV}/WEBSITES_PHP_73.csv" filename_php_73="${DST_DIR_CSV}/WEBSITES_PHP_73.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_73.php cat <<EOF > ${DST_PATH_STATS}/websites_php_73.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_73)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_73)\"");
@ -342,7 +346,7 @@ echo ";" >> $filename_php_73
_tmp_filename_php_74=$(mktemp) _tmp_filename_php_74=$(mktemp)
filename_php_74="${DST_DIR_CSV}/WEBSITES_PHP_74.csv" filename_php_74="${DST_DIR_CSV}/WEBSITES_PHP_74.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_74.php cat <<EOF > ${DST_PATH_STATS}/websites_php_74.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_74)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_74)\"");
@ -356,7 +360,7 @@ echo ";" >> $filename_php_74
_tmp_filename_php_80=$(mktemp) _tmp_filename_php_80=$(mktemp)
filename_php_80="${DST_DIR_CSV}/WEBSITES_PHP_80.csv" filename_php_80="${DST_DIR_CSV}/WEBSITES_PHP_80.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_80.php cat <<EOF > ${DST_PATH_STATS}/websites_php_80.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_80)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_80)\"");
@ -370,7 +374,7 @@ echo ";" >> $filename_php_80
_tmp_filename_php_81=$(mktemp) _tmp_filename_php_81=$(mktemp)
filename_php_81="${DST_DIR_CSV}/WEBSITES_PHP_81.csv" filename_php_81="${DST_DIR_CSV}/WEBSITES_PHP_81.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_81.php cat <<EOF > ${DST_PATH_STATS}/websites_php_81.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_81)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_81)\"");
@ -384,7 +388,7 @@ echo ";" >> $filename_php_81
_tmp_filename_php_82=$(mktemp) _tmp_filename_php_82=$(mktemp)
filename_php_82="${DST_DIR_CSV}/WEBSITES_PHP_82.csv" filename_php_82="${DST_DIR_CSV}/WEBSITES_PHP_82.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_php_82.php cat <<EOF > ${DST_PATH_STATS}/websites_php_82.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_82)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_php_82)\"");
@ -396,10 +400,24 @@ EOF
echo "Website; ;PHP Version; ;PHP Engine; ;Database; ;CMS; ;DocumentRoot; ;VHost file; ;Server Alias(es)" > $filename_php_82 echo "Website; ;PHP Version; ;PHP Engine; ;Database; ;CMS; ;DocumentRoot; ;VHost file; ;Server Alias(es)" > $filename_php_82
echo ";" >> $filename_php_82 echo ";" >> $filename_php_82
_tmp_filename_php_83=$(mktemp)
filename_php_83="${DST_DIR_CSV}/WEBSITES_PHP_83.csv"
cat <<EOF > ${DST_PATH_STATS}/websites_php_83.php
<?php
header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_php_83)\"");
header('Pragma: no-cache');
header('Expires: 0');
readfile("$filename_php_83");
?>
EOF
echo "Website; ;PHP Version; ;PHP Engine; ;Database; ;CMS; ;DocumentRoot; ;VHost file; ;Server Alias(es)" > $filename_php_83
echo ";" >> $filename_php_83
_tmp_filename_not_considered=$(mktemp) _tmp_filename_not_considered=$(mktemp)
filename_not_considered="${DST_DIR_CSV}/VHOST_FILES_NOT_CONSIDERED.csv" filename_not_considered="${DST_DIR_CSV}/VHOST_FILES_NOT_CONSIDERED.csv"
cat <<EOF > ${DST_PATH_PHP}/vhost_files_not_considered.php cat <<EOF > ${DST_PATH_STATS}/vhost_files_not_considered.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_not_considered)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_not_considered)\"");
@ -414,7 +432,7 @@ echo ";" >> $filename_not_considered
_tmp_filename_no_php_assigned=$(mktemp) _tmp_filename_no_php_assigned=$(mktemp)
filename_no_php_assigned="${DST_DIR_CSV}/WEBSITES_NO_PHP_FOUND.csv" filename_no_php_assigned="${DST_DIR_CSV}/WEBSITES_NO_PHP_FOUND.csv"
cat <<EOF > ${DST_PATH_PHP}/websites_no_php_found.php cat <<EOF > ${DST_PATH_STATS}/websites_no_php_found.php
<?php <?php
header('Content-Type:application/csv ; charset=utf-8'); header('Content-Type:application/csv ; charset=utf-8');
header("Content-Disposition: attachment; filename=\"$(basename $filename_no_php_assigned)\""); header("Content-Disposition: attachment; filename=\"$(basename $filename_no_php_assigned)\"");
@ -1082,6 +1100,13 @@ for _vhost_file in ${_all_vhost_files_arr[@]} ; do
fi fi
if [[ "$_php_version" =~ ^8.3 ]]; then
echo "$_server_name;;$_php_version;;$_php_engine;;$database;;$site_cms;;$_documentroot;;$_vhost_file;;$server_aliases" >> $_tmp_filename_php_83
((number_websites_83++))
fi
elif ! $_vhost_file_not_considered ; then elif ! $_vhost_file_not_considered ; then
_redirect_site="" _redirect_site=""
_redirect_site=$(grep -E "^\s*RewriteRule" $_vhost_file 2> /dev/null | awk '{print$3}' | sed 's/"//g' | sed 's/\/$//' | sed 's/https\?:\/\///g' | sed 's/\$1//g' | sort -u) _redirect_site=$(grep -E "^\s*RewriteRule" $_vhost_file 2> /dev/null | awk '{print$3}' | sed 's/"//g' | sed 's/\/$//' | sed 's/https\?:\/\///g' | sed 's/\$1//g' | sort -u)
@ -1131,94 +1156,170 @@ cat $_tmp_filename_no_php_assigned | sort >> $filename_no_php_assigned
# - Create summary file index.php # - Create summary file index.php
# ----- # -----
cat <<EOF > ${DST_PATH_PHP}/index.php if [[ -f "${DST_PATH_STATS}/index.php" ]]; then
rm "${DST_PATH_STATS}/index.php"
fi
cat <<EOF > ${DST_PATH_STATS}/index.html
<html> <html>
<head> <head>
<title>Statistics websites $(hostname -f)</title> <title>Statistics websites $(hostname -f)</title>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
</head> </head>
<body> <body>
<h4>$(hostname -f)</h4> <h4>$(hostname -f)</h4>
<ul> <ul>
<li><a href="websites_summary.php">full summary of all hosted websites</a>: $number_overall</li> EOF
if [[ $number_overall -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="${WEB_DIR_CSV}/$(basename $filename_summary)">full summary of all hosted websites</a>: $number_overall</li>
EOF
else
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li>full summary of all hosted websites: $number_overall</li>
EOF
fi
cat <<EOF >> ${DST_PATH_STATS}/index.html
<br /> <br />
<li><a href="websites_redirected.php">redirected websites</a>: $number_redirected</li> EOF
<li><a href="websites_parked.php">parked websites</a>: $number_parked</li> if [[ $number_redirected -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="${WEB_DIR_CSV}/$(basename $filename_redirected)">redirected websites</a>: $number_redirected</li>
EOF
else
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li>redirected websites: $number_redirected</li>
EOF
fi
if [[ $number_parked -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="${WEB_DIR_CSV}/$(basename $filename_parked)">parked websites</a>: $number_parked</li>
EOF
else
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li>parked websites: $number_parked</li>
EOF
fi
cat <<EOF >> ${DST_PATH_STATS}/index.html
<br /> <br />
<li><a href="websites_mod_php.php">websites mod_php</a>: $number_mod_php</li> EOF
<li><a href="websites_php_fpm.php">websites PHP-FPM</a>: $number_php_fpm</li> if [[ $number_mod_php -gt 0 ]]; then
<li><a href="websites_php_fcgid.php">websites FastCGI</a>: $number_php_fcgid</li> cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="${WEB_DIR_CSV}/$(basename $filename_mod_php)">websites mod_php</a>: $number_mod_php</li>
EOF
else
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li>websites mod_php: $number_mod_php</li>
EOF
fi
if [[ $number_php_fpm -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="${WEB_DIR_CSV}/$(basename $filename_php_fpm)">websites PHP-FPM</a>: $number_php_fpm</li>
EOF
else
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li>websites PHP-FPM: $number_php_fpm</li>
EOF
fi
if [[ $number_php_fcgid -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="${WEB_DIR_CSV}/$(basename $filename_php_fcgid)">websites FastCGI</a>: $number_php_fcgid</li>
EOF
else
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li>websites FastCGI: $number_php_fcgid</li>
EOF
fi
cat <<EOF >> ${DST_PATH_STATS}/index.html
<br /> <br />
<li><a href="websites_no_php_found.php">websites no PHP assigned</a>: $number_no_php_assigned</li> EOF
if [[ $number_no_php_assigned -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="${WEB_DIR_CSV}/$(basename $filename_no_php_assigned)">websites no PHP assigned</a>: $number_no_php_assigned</li>
EOF
else
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li>websites no PHP assigned: $number_no_php_assigned</li>
EOF
fi
cat <<EOF >> ${DST_PATH_STATS}/index.html
</ul> </ul>
<hr width="100" align="left"> <hr width="100" align="left">
<ul> <ul>
<li><a href="vhost_files_not_considered.php">vhost_files not considered</a>: $number_not_considered</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_not_considered)">vhost_files not considered</a>: $number_not_considered</li>
</ul> </ul>
<hr width="100" align="left"> <hr width="100" align="left">
<h5>PHP versions supported by this script:<br />&nbsp;&nbsp;&nbsp; $PHP_VERIONS_SUPPORTED</h5> <h5>PHP versions supported by this script:<br />&nbsp;&nbsp;&nbsp; $PHP_VERIONS_SUPPORTED</h5>
<ul> <ul>
EOF EOF
if [[ $number_websites_53 -gt 0 ]]; then if [[ $number_websites_53 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_53.php">websites PHP v5.3</a>: $number_websites_53</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_74)">websites PHP v5.3</a>: $number_websites_53</li>
EOF EOF
fi fi
if [[ $number_websites_54 -gt 0 ]]; then if [[ $number_websites_54 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_54.php">websites PHP v5.4</a>: $number_websites_54</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_54)">websites PHP v5.4</a>: $number_websites_54</li>
EOF EOF
fi fi
if [[ $number_websites_55 -gt 0 ]]; then if [[ $number_websites_55 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_55.php">websites PHP v5.5</a>: $number_websites_55</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_55)">websites PHP v5.5</a>: $number_websites_55</li>
EOF EOF
fi fi
if [[ $number_websites_56 -gt 0 ]]; then if [[ $number_websites_56 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_56.php">websites PHP v5.6</a>: $number_websites_56</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_56)">websites PHP v5.6</a>: $number_websites_56</li>
EOF EOF
fi fi
if [[ $number_websites_70 -gt 0 ]]; then if [[ $number_websites_70 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_70.php">websites PHP v7.0</a>: $number_websites_70</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_70)">websites PHP v7.0</a>: $number_websites_70</li>
EOF EOF
fi fi
if [[ $number_websites_71 -gt 0 ]]; then if [[ $number_websites_71 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_71.php">websites PHP v7.1</a>: $number_websites_71</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_71)">websites PHP v7.1</a>: $number_websites_71</li>
EOF EOF
fi fi
if [[ $number_websites_72 -gt 0 ]]; then if [[ $number_websites_72 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_72.php">websites PHP v7.2</a>: $number_websites_72</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_72)">websites PHP v7.2</a>: $number_websites_72</li>
EOF EOF
fi fi
if [[ $number_websites_73 -gt 0 ]]; then if [[ $number_websites_73 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_73.php">websites PHP v7.3</a>: $number_websites_73</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_73)">websites PHP v7.3</a>: $number_websites_73</li>
EOF EOF
fi fi
if [[ $number_websites_74 -gt 0 ]]; then if [[ $number_websites_74 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_74.php">websites PHP v7.4</a>: $number_websites_74</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_74)">websites PHP v7.4</a>: $number_websites_74</li>
EOF EOF
fi fi
if [[ $number_websites_80 -gt 0 ]]; then if [[ $number_websites_80 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_80.php">websites PHP v8.0</a>: $number_websites_80</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_80)">websites PHP v8.0</a>: $number_websites_80</li>
EOF EOF
fi fi
if [[ $number_websites_81 -gt 0 ]]; then if [[ $number_websites_81 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_81.php">websites PHP v8.1</a>: $number_websites_81</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_81)">websites PHP v8.1</a>: $number_websites_81</li>
EOF EOF
fi fi
if [[ $number_websites_82 -gt 0 ]]; then if [[ $number_websites_82 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_PHP}/index.php cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="websites_php_82.php">websites PHP v8.2</a>: $number_websites_82</li> <li><a href="${WEB_DIR_CSV}/$(basename $filename_php_82)">websites PHP v8.2</a>: $number_websites_82</li>
EOF EOF
fi fi
cat <<EOF >> ${DST_PATH_PHP}/index.php if [[ $number_websites_83 -gt 0 ]]; then
cat <<EOF >> ${DST_PATH_STATS}/index.html
<li><a href="${WEB_DIR_CSV}/$(basename $filename_php_83)">websites PHP v8.3</a>: $number_websites_83</li>
EOF
fi
cat <<EOF >> ${DST_PATH_STATS}/index.html
</ul> </ul>
</body> </body>
</html> </html>