add snippet 'get-cloud-instance-to-update'..
This commit is contained in:
36
snippets/get-cloud-instance-to-update
Normal file
36
snippets/get-cloud-instance-to-update
Normal file
@ -0,0 +1,36 @@
|
||||
WEBSITE=
|
||||
_OK=false
|
||||
declare -i i=0
|
||||
if [[ ${#website_arr[@]} -eq 1 ]] ; then
|
||||
IFS=':' read -a _arr <<< ${website_arr[0]}
|
||||
conf_file=${_arr[1]}
|
||||
WEBSITE=${_arr[0]}
|
||||
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]}
|
||||
WEBSITE=${_arr[0]}
|
||||
_OK=true
|
||||
else
|
||||
echo ""
|
||||
echo -e "\tFalsche Eingabe !"
|
||||
echo ""
|
||||
echononl " Eingabe: "
|
||||
fi
|
||||
done
|
||||
fi
|
Reference in New Issue
Block a user