Move snippet snippet-get-php-major-version into snippet dir and also rename it to 'get-php-major-version'.

This commit is contained in:
2023-08-02 13:13:13 +02:00
parent c0ea4fa6d4
commit f244232347
18 changed files with 57 additions and 31 deletions

View File

@ -6,6 +6,7 @@ script_name="$(basename $(realpath $0))"
script_dir="$(dirname $(realpath $0))"
conf_dir="${script_dir}/conf"
snippet_dir="${script_dir}/snippets"
declare -a unsorted_website_arr
declare -a website_arr
@ -248,30 +249,39 @@ echo -e "\033[32m-----\033[m"
WEBSITE=
_OK=false
echo ""
echo "Which site would you like to update?"
echo ""
_HEAD=false
declare -i i=0
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
if [[ ${#website_arr[@]} -eq 1 ]] ; then
IFS=':' read -a _arr <<< ${website_arr[0]}
conf_file=${_arr[1]}
echo ""
echo -e "Update site \033[1m ${_arr[0]}"
echo ""
else
echo ""
echo "Which site would you like to update?"
echo ""
for _site in ${website_arr[@]} ; do
IFS=':' read -a _arr <<< ${_site}
echo " [$i] ${_arr[0]}"
((i++))
done
echo
echononl " Eingabe: "
while ! $_OK ; do
read _IN
if is_number "$_IN" && [[ -n ${website_arr[$_IN]} ]]; then
IFS=':' read -a _arr <<< ${website_arr[$_IN]}
conf_file=${_arr[1]}
_OK=true
else
echo ""
echo -e "\tFalsche Eingabe !"
echo ""
echononl " Eingabe: "
fi
done
fi
# - Reset IFS
@ -500,7 +510,7 @@ fi
# Check PHP Version
#
source ${script_dir}/snippet-get-php-major-version
source ${snippet_dir}/get-php-major-version
# - Determin PHP binary