create_summary_websites.sh: support PHP v 7.2
This commit is contained in:
		| @@ -31,6 +31,7 @@ clean_up() { | |||||||
|    rm -f $_tmp_filename_php_56 |    rm -f $_tmp_filename_php_56 | ||||||
|    rm -f $_tmp_filename_php_70 |    rm -f $_tmp_filename_php_70 | ||||||
|    rm -f $_tmp_filename_php_71 |    rm -f $_tmp_filename_php_71 | ||||||
|  |    rm -f $_tmp_filename_php_72 | ||||||
|    rm -f $_tmp_filename_not_considered |    rm -f $_tmp_filename_not_considered | ||||||
|    exit $1 |    exit $1 | ||||||
| } | } | ||||||
| @@ -267,6 +268,20 @@ EOF | |||||||
| echo "Website; ;PHP Version; ;PHP Engine; ;Database; ;CMS; ;DocumentRoot; ;VHost file; ;Server Alias(es)" > $filename_php_71 | echo "Website; ;PHP Version; ;PHP Engine; ;Database; ;CMS; ;DocumentRoot; ;VHost file; ;Server Alias(es)" > $filename_php_71 | ||||||
| echo ";" >> $filename_php_71 | echo ";" >> $filename_php_71 | ||||||
|  |  | ||||||
|  | _tmp_filename_php_72=$(mktemp) | ||||||
|  | filename_php_72="${DST_DIR_CSV}/WEBSITES_PHP_72.csv" | ||||||
|  | cat <<EOF > ${DST_PATH_PHP}/websites_php_72.php | ||||||
|  | <?php | ||||||
|  | header('Content-Type:application/csv ; charset=utf-8'); | ||||||
|  | header("Content-Disposition: attachment; filename=\"$(basename $filename_php_72)\""); | ||||||
|  | header('Pragma: no-cache'); | ||||||
|  | header('Expires: 0'); | ||||||
|  | readfile("$filename_php_72"); | ||||||
|  | ?> | ||||||
|  | EOF | ||||||
|  | echo "Website; ;PHP Version; ;PHP Engine; ;Database; ;CMS; ;DocumentRoot; ;VHost file; ;Server Alias(es)" > $filename_php_72 | ||||||
|  | echo ";" >> $filename_php_72 | ||||||
|  |  | ||||||
|  |  | ||||||
| _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" | ||||||
| @@ -304,8 +319,9 @@ cat <<EOF > ${DST_PATH_PHP}/index.php | |||||||
|          <li><a href="websites_php_56.php">websites PHP v5.6</a></li> |          <li><a href="websites_php_56.php">websites PHP v5.6</a></li> | ||||||
|          <li><a href="websites_php_70.php">websites PHP v7.0</a></li> |          <li><a href="websites_php_70.php">websites PHP v7.0</a></li> | ||||||
|          <li><a href="websites_php_71.php">websites PHP v7.1</a></li> |          <li><a href="websites_php_71.php">websites PHP v7.1</a></li> | ||||||
|  |          <li><a href="websites_php_72.php">websites PHP v7.2</a></li> | ||||||
|          <br /> |          <br /> | ||||||
|          <li><a href="vhost_files_not_considered.php"">vhost_files not considered</a></li> |          <li><a href="vhost_files_not_considered.php">vhost_files not considered</a></li> | ||||||
|       </ul> |       </ul> | ||||||
|    </body> |    </body> | ||||||
| </html> | </html> | ||||||
| @@ -845,6 +861,10 @@ for _vhost_file in ${_all_vhost_files_arr[@]} ; do | |||||||
|          echo "$_server_name;;$_php_version;;$_php_engine;;$database;;$site_cms;;$_documentroot;;$_vhost_file;;$server_aliases" >> $_tmp_filename_php_71 |          echo "$_server_name;;$_php_version;;$_php_engine;;$database;;$site_cms;;$_documentroot;;$_vhost_file;;$server_aliases" >> $_tmp_filename_php_71 | ||||||
|       fi |       fi | ||||||
|  |  | ||||||
|  |       if [[ "$_php_version" =~ ^7.2 ]]; then | ||||||
|  |          echo "$_server_name;;$_php_version;;$_php_engine;;$database;;$site_cms;;$_documentroot;;$_vhost_file;;$server_aliases" >> $_tmp_filename_php_72 | ||||||
|  |       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) | ||||||
| @@ -872,6 +892,7 @@ cat $_tmp_filename_php_55 | sort >> $filename_php_55 | |||||||
| cat $_tmp_filename_php_56 | sort >> $filename_php_56 | cat $_tmp_filename_php_56 | sort >> $filename_php_56 | ||||||
| cat $_tmp_filename_php_70 | sort >> $filename_php_70 | cat $_tmp_filename_php_70 | sort >> $filename_php_70 | ||||||
| cat $_tmp_filename_php_71 | sort >> $filename_php_71 | cat $_tmp_filename_php_71 | sort >> $filename_php_71 | ||||||
|  | cat $_tmp_filename_php_72 | sort >> $filename_php_72 | ||||||
| cat $_tmp_filename_not_considered | sort >> $filename_not_considered | cat $_tmp_filename_not_considered | sort >> $filename_not_considered | ||||||
|  |  | ||||||
| clean_up | clean_up | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user