Skip to content

Commit 625dc2f

Browse files
Make sure curl fail if file not found
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent 0ec9a9b commit 625dc2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/components/OpenSearch/install.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ elif [ "$DISTRIBUTION" = "deb" ] || [ "$DISTRIBUTION" = "rpm" ]; then
9696
else
9797
cp -va ../../../scripts/pkg/build_templates/current/opensearch/$DISTRIBUTION/* "$OUTPUT/../"
9898
OS_REF=`yq -e '.components[] | select(.name == "OpenSearch") | .ref' ../../../manifests/$VERSION/opensearch-$VERSION.yml`
99-
curl -SL "https://raw.githubusercontent.com/opensearch-project/OpenSearch/$OS_REF/distribution/packages/src/common/env/opensearch" -o "$OUTPUT/../etc/sysconfig/opensearch"
100-
curl -SL "https://raw.githubusercontent.com/opensearch-project/OpenSearch/$OS_REF/distribution/packages/src/common/systemd/opensearch.service" -o "$OUTPUT/../usr/lib/systemd/system/opensearch.service"
99+
curl -SfL "https://raw.githubusercontent.com/opensearch-project/OpenSearch/$OS_REF/distribution/packages/src/common/env/opensearch" -o "$OUTPUT/../etc/sysconfig/opensearch" || { echo "Failed to download env file"; exit 1; }
100+
curl -SfL "https://raw.githubusercontent.com/opensearch-project/OpenSearch/$OS_REF/distribution/packages/src/common/systemd/opensearch.service" -o "$OUTPUT/../usr/lib/systemd/system/opensearch.service" || { echo "Failed to download env file"; exit 1; }
101101
# k-NN lib setups
102102
echo -e "\n\n################################" >> "$OUTPUT/../etc/sysconfig/opensearch"
103103
echo -e "# Plugin properties" >> "$OUTPUT/../etc/sysconfig/opensearch"

0 commit comments

Comments
 (0)