mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-17 18:07:46 +00: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:
@@ -99,19 +99,18 @@ done
|
|||||||
}
|
}
|
||||||
|
|
||||||
choosecontainers() {
|
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"
|
printf "What containers do you like to update? \n"
|
||||||
options
|
options
|
||||||
read -p 'Enter number(s) separated by ,(comma) : ' Choice
|
read -p 'Enter number(s) separated by , : ' Choice
|
||||||
if [ "$Choice" == "0" ] ; then
|
if [ "$Choice" == "0" ] ; then
|
||||||
SelectedUpdates=( ${NumberedUpdates[@]:1} )
|
SelectedUpdates=( ${NumberedUpdates[@]:1} )
|
||||||
ChoiceClean=$(echo $Choice|sed 's/[,.:;]/ /g')
|
ChoiceClean=$(echo $Choice|sed 's/[,.:;]/ /g')
|
||||||
else
|
else
|
||||||
ChoiceClean=$(echo $Choice|sed 's/[,.:;]/ /g')
|
ChoiceClean=$(echo $Choice|sed 's/[,.:;]/ /g')
|
||||||
SelectedUpdates=$(\
|
for s in $ChoiceClean; do
|
||||||
for s in $ChoiceClean; do
|
SelectedUpdates+=( ${NumberedUpdates[$s]} )
|
||||||
printf "%s\n" "${NumberedUpdates[${s}]}"
|
done
|
||||||
done)
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
printf "\nYou've SelectedUpdates:\n"
|
printf "\nYou've SelectedUpdates:\n"
|
||||||
@@ -141,4 +140,5 @@ if [ -n "$GotUpdates" ] ; then
|
|||||||
else
|
else
|
||||||
printf "\nNo updates available, exiting.\n"
|
printf "\nNo updates available, exiting.\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user