fix if and awk

This commit is contained in:
m0duspwnens
2024-09-03 15:20:49 -04:00
parent 6d7b76115f
commit c20ac6c2d8

View File

@@ -148,10 +148,10 @@ update_docker_containers() {
local v1=0 local v1=0
local v2=0 local v2=0
if [[ -f "$UPDATE_DIR/salt/elasticsearch.defaults.yaml" ]]; then if [[ -f "$UPDATE_DIR/salt/elasticsearch.defaults.yaml" ]]; then
v1=$(egrep " +version: " "$UPDATE_DIR/salt/elasticsearch.defaults.yaml" | awk -F: {'print $2'} | tr -d '[:space:]') v1=$(egrep " +version: " "$UPDATE_DIR/salt/elasticsearch.defaults.yaml" | awk -F: '{print $2}' | tr -d '[:space:]')
fi fi
if [[ -f "$DEFAULT_SALT_DIR/salt/elasticsearch.defaults.yaml"]]; then if [[ -f "$DEFAULT_SALT_DIR/salt/elasticsearch.defaults.yaml" ]]; then
v2=$(egrep " +version: " "$DEFAULT_SALT_DIR/salt/elasticsearch.defaults.yaml" | awk -F: {'print $2'} | tr -d '[:space:]') v2=$(egrep " +version: " "$DEFAULT_SALT_DIR/salt/elasticsearch.defaults.yaml" | awk -F: '{print $2}' | tr -d '[:space:]')
fi fi
local highest_es_version=$(compare_es_versions "$v1" "$v2") local highest_es_version=$(compare_es_versions "$v1" "$v2")
local image=$i:$highest_es_version$IMAGE_TAG_SUFFIX local image=$i:$highest_es_version$IMAGE_TAG_SUFFIX