Skip to content

Commit

Permalink
add proxy prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Nov 2, 2023
1 parent 7b6957a commit c0e672b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/cloud/install.sh
Expand Up @@ -91,6 +91,7 @@ Options:
--cert-path # Certificate path
--key-path # Private key path
--single # Whether to install on a single node (y/n)
--proxy-prefix # Sealos binary installation address proxy prefix
--zh # Chinese prompt
--en # English prompt
--help # Help information"
Expand Down Expand Up @@ -151,6 +152,7 @@ Options:
--cert-path # 证书路径
--key-path # 私钥路径
--single # 是否单节点安装 (y/n)
--proxy-prefix # sealos二进制安装地址代理前缀
--zh # 中文提示
--en # 英文提示
--help # 帮助信息"
Expand Down Expand Up @@ -228,9 +230,10 @@ init() {
if ! command -v sealos &> /dev/null; then
get_prompt "install_sealos"
read -p " " installChoice
if [[ $installChoice == "y" || $installChoice == "Y" ]]; then
curl -sfL https://raw.githubusercontent.com/labring/sealos/${SEALOS_VERSION}/scripts/install.sh |
sh -s ${SEALOS_VERSION} labring/sealos
if [[ "${installChoice,,}" == "y" ]]; then
local install_url="https://raw.githubusercontent.com/labring/sealos/${SEALOS_VERSION}/scripts/install.sh"
[ -z "$proxy_prefix" ] || install_url="${proxy_prefix%/}/$install_url"
PROXY_PREFIX=$proxy_prefix curl -sfL "$install_url" | sh -s "${SEALOS_VERSION}" labring/sealos
else
echo "Please install sealos CLI to proceed."
exit 1
Expand Down Expand Up @@ -485,6 +488,7 @@ for i in "$@"; do
--cert-path=*) cert_path="${i#*=}"; shift ;;
--key-path=*) key_path="${i#*=}"; shift ;;
--single) single="y"; shift ;;
--proxy-prefix=*) proxy_prefix="${i#*=}"; shift ;;
--zh | zh ) LANGUAGE="CN"; shift ;;
--en | en ) LANGUAGE="EN"; shift ;;
--config=* | -c ) source ${i#*=} > /dev/null; shift ;;
Expand Down Expand Up @@ -513,6 +517,7 @@ for i in "$@"; do
--cloud-port | cloud-port | \
--cert-path | cert-path | \
--key-path | key-path | \
--proxy-prefix | proxy-prefix | \
--config | config) echo "Please use '--${i#--}=' to assign value to option"; exit 1 ;;
-*) echo "Unknown option $i"; exit 1 ;;
*) ;;
Expand Down
3 changes: 3 additions & 0 deletions scripts/install.sh
Expand Up @@ -94,6 +94,9 @@ verify_downloader() {
DOWNLOADER=$1
# Set verified executable as our downloader program and return success
DOWNLOADER_PREFIX=https://github.com/${OWN_REPO}/releases/download/
if [ -n "$PROXY_PREFIX" ]; then
DOWNLOADER_PREFIX="${PROXY_PREFIX%/}/${DOWNLOADER_PREFIX}"
fi
DOWNLOADER_URL=${DOWNLOADER_PREFIX}${VERSION}/${FILE_NAME}_${VERSION##v}_linux_${ARCH}.tar.gz
return 0
}
Expand Down

0 comments on commit c0e672b

Please sign in to comment.