Added check_images

Added check_images which moves the previous $imgList into this function and removed the else as this is handled within the main .sh

Signed-off-by: Niall T <jammasterj89@gmail.com>
This commit is contained in:
jammasterj89 2019-07-29 16:15:57 +01:00 committed by Niall T
parent 50bfd11df9
commit 4bb6e19965

View file

@ -1,19 +1,21 @@
#!/bin/sh
check_images() {
if [ -n "$imgList" ]; then
pattern=$(echo "$imgList" | sed 's/,/ /g')
for img in $pattern; do
echo "Looking for image $img"
sha256=$(docker image ls "$img" -q)
sha256=$(docker images | grep $img | awk '{print $3}')
if [ -z "$sha256" ]; then
echo "Image $img not found. Exiting."
exit 1
fi
images="$images $sha256 "
done
else
images=$(docker images -q)
images="$sha256"
echo "images ------------------------------------ " $images
echo "sha356" $sha256
done
fi
}
check_4() {
logit "\n"