Skip to content

Commit 6b92aea

Browse files
committed
[skip ci] add freebsd packages to uris if requested version is v2.x
1 parent 6e15c39 commit 6b92aea

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

scripts/packages/package-check.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [[ ! -z ${CERT} ]] && [[ ! -z ${KEY} ]]; then
3434
fi
3535

3636
if [[ -z ${PKG_REPO} ]]; then
37-
echo "defaulting to packages.nginx.com"
37+
echo "defaulting to packages.nginx.org"
3838
PKG_REPO="packages.nginx.org"
3939
fi
4040

@@ -44,7 +44,6 @@ if [[ -z $VERSION ]]; then
4444
echo "no version provided"
4545
exit 1
4646
fi
47-
4847
PKG_DIR="${PKG_REPO}/${PKG_NAME}"
4948
PKG_REPO_URL="https://${PKG_DIR}"
5049

@@ -93,6 +92,11 @@ CENTOS=(
9392
centos/8/x86_64/RPMS/nginx-agent-$VERSION.el8.ngx.x86_64.rpm
9493
)
9594

95+
FREEBSD=(
96+
freebsd/FreeBSD:12:amd64/latest/nginx-agent-$VERSION.pkg
97+
freebsd/FreeBSD:13:amd64/latest/nginx-agent-$VERSION.pkg
98+
)
99+
96100
uris=(
97101
${DEBIAN[@]}
98102
${UBUNTU[@]}
@@ -102,6 +106,13 @@ uris=(
102106
${SUSE[@]}
103107
)
104108

109+
majorVersion=$(echo ${VERSION} | cut -d. -f1)
110+
if [[ ${majorVersion} == 2 ]]; then
111+
uris+=(${FREEBSD[@]})
112+
fi
113+
114+
# Functions
115+
105116
## Check and download if nginx-agent packages are present in the repository
106117
check_pkgs () {
107118
for pkg in ${uris[@]}; do
@@ -156,7 +167,12 @@ check_repo() {
156167
else
157168
echo -e "${GREEN}Found!${NC}"
158169
fi
170+
171+
# Grep index.xml for all supported operating system versions
172+
159173
}
160174

175+
# Main
176+
161177
check_repo
162178
check_pkgs

0 commit comments

Comments
 (0)