Add checks for cms 'drupal' and 'redaxo'.
This commit is contained in:
parent
ef7e3de3a5
commit
b2a740b118
@ -408,10 +408,14 @@ for _vhost_file in ${_all_vhost_files_arr[@]} ; do
|
||||
|
||||
site_cms="Unknown"
|
||||
database="Not found"
|
||||
cms_version="Unkown"
|
||||
|
||||
file_to_check="$(dirname $_documentroot)/db.inc.php"
|
||||
file_to_check_mediawiki="$(dirname $_documentroot)/htdocs/LocalSettings.php"
|
||||
file_to_check_wordpress="$(dirname $_documentroot)/htdocs/wp-config.php"
|
||||
file_to_check_mediawiki="${_documentroot}/LocalSettings.php"
|
||||
file_to_check_wordpress="${_documentroot}/wp-config.php"
|
||||
file_to_check_drupal="${_documentroot}/sites/default/settings.php"
|
||||
file_to_check_typo3="${_documentroot}/typo3conf/LocalConfiguration.php"
|
||||
file_to_check_redaxo="${_documentroot}/redaxo/include/master.inc.php"
|
||||
|
||||
_found=false
|
||||
if [[ -r "$file_to_check_mediawiki" ]] && [[ ! -d "$file_to_check_mediawiki" ]] ; then
|
||||
@ -441,7 +445,27 @@ for _vhost_file in ${_all_vhost_files_arr[@]} ; do
|
||||
_found=true
|
||||
fi
|
||||
|
||||
site_cms="MediaWiki"
|
||||
if [[ -f "${_documentroot}/includes/DefaultSettings.php" ]]; then
|
||||
version_search_string='\$wgVersion\s+='
|
||||
cms_version="$(grep -i -E "^\s*$version_search_string" "${_documentroot}/includes/DefaultSettings.php" 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| awk -F ';' '{print$1}'\
|
||||
| tail -1)"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version%"${cms_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
cms_version="${cms_version%"${cms_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
cms_version="${cms_version%"${cms_version##*[!\']}"}"
|
||||
|
||||
fi
|
||||
|
||||
site_cms="MediaWiki $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check_wordpress" ]] && [[ ! -d "$file_to_check_wordpress" ]] ; then
|
||||
|
||||
@ -469,7 +493,229 @@ for _vhost_file in ${_all_vhost_files_arr[@]} ; do
|
||||
|
||||
fi
|
||||
|
||||
site_cms="WordPress"
|
||||
if [[ -f "${_documentroot}/wp-includes/version.php" ]]; then
|
||||
version_search_string='\$wp_version\s+='
|
||||
cms_version="$(grep -i -E "^\s*$version_search_string" ${_documentroot}/wp-includes/version.php 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version%"${cms_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
cms_version="${cms_version%"${cms_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
cms_version="${cms_version%"${cms_version##*[!\']}"}"
|
||||
fi
|
||||
|
||||
site_cms="WordPress $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check_drupal" ]] && [[ ! -d "$file_to_check_drupal" ]] ; then
|
||||
|
||||
db_search_string="'database'\s+=>"
|
||||
_found=false
|
||||
if grep -i -q -E "^\s*$db_search_string" $file_to_check_drupal > /dev/null 2>&1 ; then
|
||||
|
||||
database="$(grep -i -E "^\s*$db_search_string" $file_to_check_drupal 2> /dev/null \
|
||||
| awk -F '=>' '{print$2}' \
|
||||
| awk -F ',' '{print$1}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
database="${database#"${database%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database%"${database##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
database="${database%"${database##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database#"${database%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
database="${database%"${database##*[!\']}"}"
|
||||
|
||||
_found=true
|
||||
|
||||
fi
|
||||
|
||||
if [[ -f "${_documentroot}/includes/bootstrap.inc" ]] ; then
|
||||
version_search_string="define\('VERSION'"
|
||||
cms_version="$(grep -i -E "^\s*$version_search_string" ${_documentroot}/includes/bootstrap.inc 2> /dev/null \
|
||||
| awk -F ',' '{print$2}' \
|
||||
| awk -F ')' '{print$1}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version%"${cms_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
cms_version="${cms_version%"${cms_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
cms_version="${cms_version%"${cms_version##*[!\']}"}"
|
||||
fi
|
||||
|
||||
site_cms="Drupal $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check_typo3" ]] && [[ ! -d "$file_to_check_typo3" ]] ; then
|
||||
|
||||
db_search_string="'database'\s+=>"
|
||||
_found=false
|
||||
if grep -i -q -E "^\s*$db_search_string" $file_to_check_typo3 > /dev/null 2>&1 ; then
|
||||
|
||||
database="$(grep -i -E "^\s*$db_search_string" $file_to_check_typo3 2> /dev/null \
|
||||
| awk -F '=>' '{print$2}' \
|
||||
| awk -F ',' '{print$1}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
database="${database#"${database%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database%"${database##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
database="${database%"${database##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database#"${database%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
database="${database%"${database##*[!\']}"}"
|
||||
|
||||
_found=true
|
||||
|
||||
fi
|
||||
|
||||
if [[ -f "${_documentroot}/typo3_src/ChangeLog" ]] ; then
|
||||
version_search_string='\[RELEASE\]\s+Release\s+of\s+TYPO3'
|
||||
cms_version="$(grep -i -m 1 -E "$version_search_string" ${_documentroot}/typo3_src/ChangeLog 2> /dev/null \
|
||||
| grep -o -E "\s+[0-9]+.[0-9]+.[0-9]+\s+")"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version%"${cms_version##*[![:space:]]}"}"
|
||||
fi
|
||||
|
||||
site_cms="Typo3 $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check_redaxo" ]] && [[ ! -d "$file_to_check_redaxo" ]] ; then
|
||||
|
||||
db_search_string="\\\$REX\['DB'\]\['1'\]\['NAME'\]\s+="
|
||||
_found=false
|
||||
if grep -i -q -E "^\s*$db_search_string" $file_to_check_redaxo > /dev/null 2>&1 ; then
|
||||
|
||||
database="$(grep -i -E "^\s*$db_search_string" $file_to_check_redaxo 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
database="${database#"${database%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database%"${database##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
database="${database%"${database##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database#"${database%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
database="${database%"${database##*[!\']}"}"
|
||||
|
||||
_found=true
|
||||
|
||||
fi
|
||||
|
||||
main_version_search_string="\\\$REX\['VERSION'\]\s+="
|
||||
if grep -i -q -E "^\s*$main_version_search_string" $file_to_check_redaxo > /dev/null 2>&1 ; then
|
||||
|
||||
main_version="$(grep -i -E "^\s*$main_version_search_string" $file_to_check_redaxo 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
main_version="${main_version#"${main_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
main_version="${main_version%"${main_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
main_version="${main_version%"${main_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
main_version="${main_version#"${main_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
main_version="${main_version%"${main_version##*[!\']}"}"
|
||||
# - Remove leading single quote
|
||||
main_version="${main_version#"${main_version%%[!\']*}"}"
|
||||
# - Remove trailing single quote
|
||||
main_version="${main_version%"${main_version##*[!\']}"}"
|
||||
# - Remove leading double quote
|
||||
main_version="${main_version#"${main_version%%[!\"]*}"}"
|
||||
# - Remove trailing double quote
|
||||
main_version="${main_version%"${main_version##*[!\"]}"}"
|
||||
|
||||
sub_version_search_string="\\\$REX\['SUBVERSION'\]\s+="
|
||||
if grep -i -q -E "^\s*$sub_version_search_string" $file_to_check_redaxo > /dev/null 2>&1 ; then
|
||||
|
||||
sub_version="$(grep -i -E "^\s*$sub_version_search_string" $file_to_check_redaxo 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
sub_version="${sub_version#"${sub_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
sub_version="${sub_version%"${sub_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
sub_version="${sub_version%"${sub_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
sub_version="${sub_version#"${sub_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
sub_version="${sub_version%"${sub_version##*[!\']}"}"
|
||||
# - Remove leading single quote
|
||||
sub_version="${sub_version#"${sub_version%%[!\']*}"}"
|
||||
# - Remove trailing single quote
|
||||
sub_version="${sub_version%"${sub_version##*[!\']}"}"
|
||||
# - Remove leading double quote
|
||||
sub_version="${sub_version#"${sub_version%%[!\"]*}"}"
|
||||
# - Remove trailing double quote
|
||||
sub_version="${sub_version%"${sub_version##*[!\"]}"}"
|
||||
|
||||
minor_version_search_string="\\\$REX\['MINORVERSION'\]\s+="
|
||||
if grep -i -q -E "^\s*$minor_version_search_string" $file_to_check_redaxo > /dev/null 2>&1 ; then
|
||||
|
||||
minor_version="$(grep -i -E "^\s*$minor_version_search_string" $file_to_check_redaxo 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
minor_version="${minor_version#"${minor_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
minor_version="${minor_version%"${minor_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
minor_version="${minor_version%"${minor_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
minor_version="${minor_version#"${minor_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
minor_version="${minor_version%"${minor_version##*[!\']}"}"
|
||||
# - Remove leading single quote
|
||||
minor_version="${minor_version#"${minor_version%%[!\']*}"}"
|
||||
# - Remove trailing single quote
|
||||
minor_version="${minor_version%"${minor_version##*[!\']}"}"
|
||||
# - Remove leading double quote
|
||||
minor_version="${minor_version#"${minor_version%%[!\"]*}"}"
|
||||
# - Remove trailing double quote
|
||||
minor_version="${minor_version%"${minor_version##*[!\"]}"}"
|
||||
|
||||
else
|
||||
minor_version="?"
|
||||
fi
|
||||
|
||||
else
|
||||
sub_version="?"
|
||||
minor_version="?"
|
||||
fi
|
||||
|
||||
cms_version="${main_version}.${sub_version}.$minor_version"
|
||||
|
||||
fi
|
||||
|
||||
site_cms="REDAXO $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check" ]] && [[ ! -d "$file_to_check" ]]; then
|
||||
db_search_strings=('\$db_name' '\$mysql_db')
|
||||
|
@ -709,8 +709,11 @@ for domain in "${domain_req_for_del_arr[@]}" ; do
|
||||
site_cms="Unknown"
|
||||
|
||||
file_to_check="$(dirname $_doc_root)/db.inc.php"
|
||||
file_to_check_mediawiki="$(dirname $_doc_root)/htdocs/LocalSettings.php"
|
||||
file_to_check_wordpress="$(dirname $_doc_root)/htdocs/wp-config.php"
|
||||
file_to_check_mediawiki="${_doc_root}/LocalSettings.php"
|
||||
file_to_check_wordpress="${_doc_root}/wp-config.php"
|
||||
file_to_check_drupal="${_doc_root}/sites/default/settings.php"
|
||||
file_to_check_typo3="${_doc_root}/typo3conf/LocalConfiguration.php"
|
||||
file_to_check_redaxo="${_doc_root}/redaxo/include/master.inc.php"
|
||||
|
||||
_found=false
|
||||
if [[ -r "$file_to_check_mediawiki" ]] && [[ ! -d "$file_to_check_mediawiki" ]] ; then
|
||||
@ -740,7 +743,27 @@ for domain in "${domain_req_for_del_arr[@]}" ; do
|
||||
_found=true
|
||||
fi
|
||||
|
||||
site_cms="MediaWiki"
|
||||
if [[ -f "${_doc_root}/includes/DefaultSettings.php" ]]; then
|
||||
version_search_string='\$wgVersion\s+='
|
||||
cms_version="$(grep -i -E "^\s*$version_search_string" "${_doc_root}/includes/DefaultSettings.php" 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| awk -F ';' '{print$1}'\
|
||||
| tail -1)"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version%"${cms_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
cms_version="${cms_version%"${cms_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
cms_version="${cms_version%"${cms_version##*[!\']}"}"
|
||||
|
||||
fi
|
||||
|
||||
site_cms="MediaWiki $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check_wordpress" ]] && [[ ! -d "$file_to_check_wordpress" ]] ; then
|
||||
|
||||
@ -768,7 +791,229 @@ for domain in "${domain_req_for_del_arr[@]}" ; do
|
||||
|
||||
fi
|
||||
|
||||
site_cms="WordPress"
|
||||
if [[ -f "${_doc_root}/wp-includes/version.php" ]]; then
|
||||
version_search_string='\$wp_version\s+='
|
||||
cms_version="$(grep -i -E "^\s*$version_search_string" ${_doc_root}/wp-includes/version.php 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version%"${cms_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
cms_version="${cms_version%"${cms_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
cms_version="${cms_version%"${cms_version##*[!\']}"}"
|
||||
fi
|
||||
|
||||
site_cms="WordPress $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check_drupal" ]] && [[ ! -d "$file_to_check_drupal" ]] ; then
|
||||
|
||||
db_search_string="'database'\s+=>"
|
||||
_found=false
|
||||
if grep -i -q -E "^\s*$db_search_string" $file_to_check_drupal > /dev/null 2>&1 ; then
|
||||
|
||||
database="$(grep -i -E "^\s*$db_search_string" $file_to_check_drupal 2> /dev/null \
|
||||
| awk -F '=>' '{print$2}' \
|
||||
| awk -F ',' '{print$1}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
database="${database#"${database%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database%"${database##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
database="${database%"${database##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database#"${database%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
database="${database%"${database##*[!\']}"}"
|
||||
|
||||
_found=true
|
||||
|
||||
fi
|
||||
|
||||
if [[ -f "${_doc_root}/includes/bootstrap.inc" ]] ; then
|
||||
version_search_string="define\('VERSION'"
|
||||
cms_version="$(grep -i -E "^\s*$version_search_string" ${_doc_root}/includes/bootstrap.inc 2> /dev/null \
|
||||
| awk -F ',' '{print$2}' \
|
||||
| awk -F ')' '{print$1}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version%"${cms_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
cms_version="${cms_version%"${cms_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
cms_version="${cms_version%"${cms_version##*[!\']}"}"
|
||||
fi
|
||||
|
||||
site_cms="Drupal $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check_typo3" ]] && [[ ! -d "$file_to_check_typo3" ]] ; then
|
||||
|
||||
db_search_string="'database'\s+=>"
|
||||
_found=false
|
||||
if grep -i -q -E "^\s*$db_search_string" $file_to_check_typo3 > /dev/null 2>&1 ; then
|
||||
|
||||
database="$(grep -i -E "^\s*$db_search_string" $file_to_check_typo3 2> /dev/null \
|
||||
| awk -F '=>' '{print$2}' \
|
||||
| awk -F ',' '{print$1}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
database="${database#"${database%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database%"${database##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
database="${database%"${database##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database#"${database%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
database="${database%"${database##*[!\']}"}"
|
||||
|
||||
_found=true
|
||||
|
||||
fi
|
||||
|
||||
if [[ -f "${_doc_root}/typo3_src/ChangeLog" ]] ; then
|
||||
version_search_string='\[RELEASE\]\s+Release\s+of\s+TYPO3'
|
||||
cms_version="$(grep -i -m 1 -E "$version_search_string" ${_doc_root}/typo3_src/ChangeLog 2> /dev/null \
|
||||
| grep -o -E "\s+[0-9]+.[0-9]+.[0-9]+\s+")"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
cms_version="${cms_version#"${cms_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
cms_version="${cms_version%"${cms_version##*[![:space:]]}"}"
|
||||
fi
|
||||
|
||||
site_cms="Typo3 $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check_redaxo" ]] && [[ ! -d "$file_to_check_redaxo" ]] ; then
|
||||
|
||||
db_search_string="\\\$REX\['DB'\]\['1'\]\['NAME'\]\s+="
|
||||
_found=false
|
||||
if grep -i -q -E "^\s*$db_search_string" $file_to_check_redaxo > /dev/null 2>&1 ; then
|
||||
|
||||
database="$(grep -i -E "^\s*$db_search_string" $file_to_check_redaxo 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
database="${database#"${database%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database%"${database##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
database="${database%"${database##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
database="${database#"${database%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
database="${database%"${database##*[!\']}"}"
|
||||
|
||||
_found=true
|
||||
|
||||
fi
|
||||
|
||||
main_version_search_string="\\\$REX\['VERSION'\]\s+="
|
||||
if grep -i -q -E "^\s*$main_version_search_string" $file_to_check_redaxo > /dev/null 2>&1 ; then
|
||||
|
||||
main_version="$(grep -i -E "^\s*$main_version_search_string" $file_to_check_redaxo 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
main_version="${main_version#"${main_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
main_version="${main_version%"${main_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
main_version="${main_version%"${main_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
main_version="${main_version#"${main_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
main_version="${main_version%"${main_version##*[!\']}"}"
|
||||
# - Remove leading single quote
|
||||
main_version="${main_version#"${main_version%%[!\']*}"}"
|
||||
# - Remove trailing single quote
|
||||
main_version="${main_version%"${main_version##*[!\']}"}"
|
||||
# - Remove leading double quote
|
||||
main_version="${main_version#"${main_version%%[!\"]*}"}"
|
||||
# - Remove trailing double quote
|
||||
main_version="${main_version%"${main_version##*[!\"]}"}"
|
||||
|
||||
sub_version_search_string="\\\$REX\['SUBVERSION'\]\s+="
|
||||
if grep -i -q -E "^\s*$sub_version_search_string" $file_to_check_redaxo > /dev/null 2>&1 ; then
|
||||
|
||||
sub_version="$(grep -i -E "^\s*$sub_version_search_string" $file_to_check_redaxo 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
sub_version="${sub_version#"${sub_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
sub_version="${sub_version%"${sub_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
sub_version="${sub_version%"${sub_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
sub_version="${sub_version#"${sub_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
sub_version="${sub_version%"${sub_version##*[!\']}"}"
|
||||
# - Remove leading single quote
|
||||
sub_version="${sub_version#"${sub_version%%[!\']*}"}"
|
||||
# - Remove trailing single quote
|
||||
sub_version="${sub_version%"${sub_version##*[!\']}"}"
|
||||
# - Remove leading double quote
|
||||
sub_version="${sub_version#"${sub_version%%[!\"]*}"}"
|
||||
# - Remove trailing double quote
|
||||
sub_version="${sub_version%"${sub_version##*[!\"]}"}"
|
||||
|
||||
minor_version_search_string="\\\$REX\['MINORVERSION'\]\s+="
|
||||
if grep -i -q -E "^\s*$minor_version_search_string" $file_to_check_redaxo > /dev/null 2>&1 ; then
|
||||
|
||||
minor_version="$(grep -i -E "^\s*$minor_version_search_string" $file_to_check_redaxo 2> /dev/null \
|
||||
| awk -F '=' '{print$2}' \
|
||||
| tail -1 )"
|
||||
|
||||
# - Remove leading whitespace characters
|
||||
minor_version="${minor_version#"${minor_version%%[![:space:]]*}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
minor_version="${minor_version%"${minor_version##*[![:space:]]}"}"
|
||||
# - Rmove trailing semicolon characters
|
||||
minor_version="${minor_version%"${minor_version##*[!;]}"}"
|
||||
# - Remove trailing whitespace characters
|
||||
minor_version="${minor_version#"${minor_version%%[!\']*}"}"
|
||||
# - Remove trailing inverted comma characters
|
||||
minor_version="${minor_version%"${minor_version##*[!\']}"}"
|
||||
# - Remove leading single quote
|
||||
minor_version="${minor_version#"${minor_version%%[!\']*}"}"
|
||||
# - Remove trailing single quote
|
||||
minor_version="${minor_version%"${minor_version##*[!\']}"}"
|
||||
# - Remove leading double quote
|
||||
minor_version="${minor_version#"${minor_version%%[!\"]*}"}"
|
||||
# - Remove trailing double quote
|
||||
minor_version="${minor_version%"${minor_version##*[!\"]}"}"
|
||||
|
||||
else
|
||||
minor_version="?"
|
||||
fi
|
||||
|
||||
else
|
||||
sub_version="?"
|
||||
minor_version="?"
|
||||
fi
|
||||
|
||||
cms_version="${main_version}.${sub_version}.$minor_version"
|
||||
|
||||
fi
|
||||
|
||||
site_cms="REDAXO $cms_version"
|
||||
|
||||
elif [[ -r "$file_to_check" ]] && [[ ! -d "$file_to_check" ]]; then
|
||||
db_search_strings=('\$db_name' '\$mysql_db')
|
||||
|
Loading…
Reference in New Issue
Block a user