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
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大鹅i

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值