mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-06-14 22:28:43 +02:00
Pull image if missing when enabling module in so-learn
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2014,2015,2016,2017,2018,2019,2020,2021 Security Onion Solutions, LLC
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
. /usr/sbin/so-common
|
||||
. /usr/sbin/so-image-common
|
||||
|
||||
usage() {
|
||||
read -r -d '' message <<- EOM
|
||||
usage: so-image-pull [-h] IMAGE [IMAGE ...]
|
||||
|
||||
positional arguments:
|
||||
IMAGE One or more 'so-' prefixed images to download and verify.
|
||||
|
||||
optional arguments:
|
||||
-h, --help Show this help message and exit.
|
||||
EOM
|
||||
echo "$message"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [[ $# -eq 0 || $# -gt 1 ]] || [[ $1 == '-h' || $1 == '--help' ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
TRUSTED_CONTAINERS=("$@")
|
||||
set_version
|
||||
|
||||
for image in "${TRUSTED_CONTAINERS[@]}"; do
|
||||
if ! docker images | grep "$image" | grep ":5000" | grep -q "$VERSION"; then
|
||||
update_docker_containers "$image" "" "" ""
|
||||
else
|
||||
echo "$image:$VERSION image exists." 1>&2
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user