helm自动安装脚本(添加自动补全)

简介: helm自动安装脚本(添加自动补全)
#!/bin/bash
## dir HAITAO
## for instll helm
type helm
if [ $? == 0 ];then
echo "存在helm命令"
else
#检查PATH文件
if [ ! -d "/usr/local/bin" ];then
mkdir -p /usr/local/bin
cat >>/root/.bashrc<<EOF
if [ -d /usr/local/bin ] ; then
export PATH=/usr/local/bin:$PATH
fi
EOF
source /root/.bashrc
fi
curl https://raw.githubusercontent.com
if [ $? != 0 ];then
#二进制安装(无法下载自动脚本时)
wget https://get.helm.sh/helm-v3.7.2-linux-amd64.tar.gz
wait
tar -zxvf helm-v3.7.2-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin
else
#自动脚本安装helm(需要服务器能上外网)
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
fi
type helm
if [ $? == 0 ];then
#添加自动补全
echo "source <(helm completion bash)" >>  ~/.bash_profile
echo "请执行 source <(helm completion bash) 当即生效自动补全,或者 重启ssh窗口!!!"
else
echo "安装失败,请检查!"
fi
fi
#!/bin/bash
## dir HAITAO
## for instll helm
type helm
if [ $? == 0 ];then
echo "存在helm命令"
else
#检查PATH文件
if [ ! -d "/usr/local/bin" ];then
mkdir -p /usr/local/bin
cat >>/root/.bashrc<<EOF
if [ -d /usr/local/bin ] ; then
export PATH=/usr/local/bin:$PATH
fi
EOF
source /root/.bashrc
fi
curl https://raw.githubusercontent.com
if [ $? != 0 ];then
#二进制安装(无法下载自动脚本时)
wget https://get.helm.sh/helm-v3.7.2-linux-amd64.tar.gz
wait
tar -zxvf helm-v3.7.2-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin
else
#自动脚本安装helm(需要服务器能上外网)
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
fi
type helm
if [ $? == 0 ];then
#添加自动补全
echo "source <(helm completion bash)" >>  ~/.bash_profile
echo "请执行 source <(helm completion bash) 当即生效自动补全,或者 重启ssh窗口!!!"
else
echo "安装失败,请检查!"
fi
fi
目录
相关文章
|
7月前
|
Kubernetes Shell Linux
1分钟配置Kubectl命令自动补全功能
1分钟配置Kubectl命令自动补全功能
133 0
|
4天前
|
资源调度 jenkins 持续交付
jenkins 自动安装nodejs16.16.0版本报错处理
jenkins 自动安装nodejs16.16.0版本报错处理
31 0
|
Shell Docker 容器
笔记:Docker命令自动补全
笔记:Docker命令自动补全 一 背景 作为一名 Linux 重度用户,每次敲命令总会情不自禁地按下 Tab 键。在键入 Docker 命令时也会出现类似的习惯性动作。那么是否 Docker 相关命令也能自动补全呢? 二 操作步骤 2.1 安装 bash-completion sudo yum install -y bash-completion 安装完成之后重启系统或者重新登录 shell。
21525 0
|
4天前
|
Ubuntu 关系型数据库 MySQL
ubuntu部署python环境,vscode编辑wsl项目遇到的问题汇总
ubuntu部署python环境,vscode编辑wsl项目遇到的问题汇总
|
4天前
vscode命令操作
vscode命令操作
|
4天前
命令行启动vscode
命令行启动vscode
41 1
|
5月前
|
Ubuntu Unix Shell
Kubectl 好用的命令行工具:oh-my-zsh 技巧和窍门
Kubectl 好用的命令行工具:oh-my-zsh 技巧和窍门
90 0
|
jenkins 测试技术 持续交付
Jenkins脚本命令行应用总结
Jenkins脚本命令行应用总结
188 0
|
对象存储 开发者 Python
命令行工具安装和配置 | 学习笔记
快速学习命令行工具安装和配置
119 0
命令行工具安装和配置 | 学习笔记
发布一个npm包和命令行脚本
发布一个npm包和命令行脚本
130 0