Skip to content

Commit 6aa8dc7

Browse files
committed
fix: updating script to use only curl
1 parent a64ef5f commit 6aa8dc7

File tree

1 file changed

+17
-24
lines changed

1 file changed

+17
-24
lines changed

static/scripts/install-nim-bundle.sh

100644100755
Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ if ! cmd=$(command -v "tar") || [ ! -x "$cmd" ]; then
1515
exit 1
1616
fi
1717

18-
if ! cmd=$(command -v "wget") || [ ! -x "$cmd" ]; then
19-
echo "wget command not found. Install wget to run this script."
20-
exit 1
21-
fi
22-
2318
NGINX_CERT_PATH="/etc/ssl/nginx/nginx-repo.crt"
2419
NGINX_CERT_KEY_PATH="/etc/ssl/nginx/nginx-repo.key"
2520
LICENSE_JWT_PATH=""
@@ -401,7 +396,7 @@ installBundleForRPMDistro(){
401396
fi
402397
printf "[nginx-plus]\nname=nginx-plus repo\nbaseurl=https://pkgs.nginx.com/plus/$os_type/\$releasever/\$basearch/\nsslclientcert=/etc/ssl/nginx/nginx-repo.crt\nsslclientkey=/etc/ssl/nginx/nginx-repo.key\ngpgcheck=0\nenabled=1" >> /etc/yum.repos.d/nginx-plus.repo
403398

404-
yum install -y yum-utils wget epel-release ca-certificates
399+
yum install -y yum-utils curl epel-release ca-certificates
405400
yum-config-manager --enable nginx-stable
406401
yum-config-manager --enable nginx-plus
407402

@@ -457,7 +452,7 @@ installBundleForRPMDistro(){
457452
systemctl start clickhouse-server
458453
check_last_command_status "systemctl start clickhouse-server" $?
459454

460-
wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/nms.repo
455+
curl -o /etc/yum.repos.d/nms.repo https://cs.nginx.com/static/files/nms.repo
461456
check_last_command_status "get -P /etc/yum.repos.d https://cs.nginx.com/static/files/nms.repo" $?
462457

463458
if cat /etc/*-release | grep -iq 'Amazon Linux'; then
@@ -515,9 +510,8 @@ install_nim_online(){
515510
}
516511

517512
printUsageInfo(){
518-
echo "Usage: $0 [-c /path/to/nginx-repo.crt] [-k /path/to/nginx-repo.key] [-p nginx_plus_version] [-s security_module_version] -i [installable_tar_file_path] [-n nginx_oss_version] [-m mode(online/offline)]
519-
[-d distribution (ubuntu20.04,ubuntu22.04,ubuntu24.04,debian11,debian12,centos8,rhel8,rhel9,oracle7,oracle8,amzn2)] [-h print help]"
520-
printf "\n -m <mode> Online/Offline. Controls whether to install from the internet or from a package created using this script. \n"
513+
echo "Usage: $0 [-c /path/to/nginx-repo.crt] [-k /path/to/nginx-repo.key] [-p nginx_plus_version] [-s security_module_version] -i [installable_tar_file_path] [-n nginx_oss_version] [-m mode(online/offline)] [-d distribution (ubuntu20.04,ubuntu22.04,ubuntu24.04,debian11,debian12,centos8,rhel8,rhel9,oracle7,oracle8,amzn2)] [-h print help]"
514+
printf "\n\n -m <mode> online/offline. Controls whether to install from the internet or from a package created using this script. \n"
521515
printf "\n -c /path/to/your/<nginx-repo.crt> file.\n"
522516
printf "\n -k /path/to/your/<nginx-repo.key> file.\n"
523517
printf "\n -p <nginx_plus_version>. Include NGINX Plus version to install as an API gateway. Valid values are 'latest' and specific versions like R32. For a list, see https://docs.nginx.com/nginx/releases/. Supersedes -n.\n"
@@ -533,19 +527,18 @@ printUsageInfo(){
533527
}
534528

535529
printSupportedOS(){
536-
echo "This script can be run on the following operating systems
537-
[-d distribution (ubuntu20.04,ubuntu22.04,ubuntu24.04,debian11,debian12,centos8,rhel8,rhel9,oracle7,oracle8,amzn2)] [-h print help]"
538-
printf "\n ubuntu20.04(focal)"
539-
printf "\n ubuntu22.04(jammy)"
540-
printf "\n ubuntu24.04(noble)"
541-
printf "\n debian11(bullseye)"
542-
printf "\n debian12(bookworm)"
543-
printf "\n centos8(CentOS 8)"
544-
printf "\n rhel8(Redhat Enterprise Linux Version 8)"
545-
printf "\n rhel9( Redhat Enterprise Linux Version 9)"
546-
printf "\n oracle7(Oracle Linux Version 7)"
547-
printf "\n oracle8(Oracle Linux Version 8)"
548-
printf "\n amzn2(Amazon Linux 2)"
530+
printf "This script can be run on the following operating systems"
531+
printf "\n 1. ubuntu20.04(focal)"
532+
printf "\n 2. ubuntu22.04(jammy)"
533+
printf "\n 3. ubuntu24.04(noble)"
534+
printf "\n 4. debian11(bullseye)"
535+
printf "\n 5. debian12(bookworm)"
536+
printf "\n 6. centos8(CentOS 8)"
537+
printf "\n 7. rhel8(Redhat Enterprise Linux Version 8)"
538+
printf "\n 8. rhel9( Redhat Enterprise Linux Version 9)"
539+
printf "\n 9. oracle7(Oracle Linux Version 7)"
540+
printf "\n 10. oracle8(Oracle Linux Version 8)"
541+
printf "\n 11. amzn2(Amazon Linux 2)\n"
549542
exit 0
550543
}
551544

@@ -671,7 +664,7 @@ This action deletes all files in the following directories: /etc/nms , /etc/ngin
671664
fi
672665
}
673666

674-
OPTS_STRING="k:c:m:d:i:s:p:n:hv:t:j:rf:"
667+
OPTS_STRING="k:c:m:d:i:s:p:n:hv:t:j:rf:l"
675668
while getopts ${OPTS_STRING} opt; do
676669
case ${opt} in
677670
c)

0 commit comments

Comments
 (0)