mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-15 07:48:14 +01:00
fixed array.
Choosing what containers to update was broken due to array mistakenly was a list. Now fixed and should work fine, no matter what order specified eg. `5,1,2,7`
This commit is contained in:
parent
07edbac00b
commit
4d14244133
1 changed files with 6 additions and 6 deletions
|
|
@ -99,19 +99,18 @@ done
|
|||
}
|
||||
|
||||
choosecontainers() {
|
||||
while [[ "$ChoiceClean" =~ [A-Za-z] || -z "$ChoiceClean" ]]; do
|
||||
while [[ "$ChoiceClean" =~ [A-Za-z] || -z "$ChoiceClean" ]]; do
|
||||
printf "What containers do you like to update? \n"
|
||||
options
|
||||
read -p 'Enter number(s) separated by ,(comma) : ' Choice
|
||||
read -p 'Enter number(s) separated by , : ' Choice
|
||||
if [ "$Choice" == "0" ] ; then
|
||||
SelectedUpdates=( ${NumberedUpdates[@]:1} )
|
||||
ChoiceClean=$(echo $Choice|sed 's/[,.:;]/ /g')
|
||||
else
|
||||
ChoiceClean=$(echo $Choice|sed 's/[,.:;]/ /g')
|
||||
SelectedUpdates=$(\
|
||||
for s in $ChoiceClean; do
|
||||
printf "%s\n" "${NumberedUpdates[${s}]}"
|
||||
done)
|
||||
for s in $ChoiceClean; do
|
||||
SelectedUpdates+=( ${NumberedUpdates[$s]} )
|
||||
done
|
||||
fi
|
||||
done
|
||||
printf "\nYou've SelectedUpdates:\n"
|
||||
|
|
@ -141,4 +140,5 @@ if [ -n "$GotUpdates" ] ; then
|
|||
else
|
||||
printf "\nNo updates available, exiting.\n"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue