1 Star 2 Fork 1

hxsaj/tools_shell

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
k8s.sh 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
hxsaj 提交于 2024-03-18 01:19 . 新增部署mysql8
#!/usr/bin/env bash
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
# Function :CentOS7.X k8s 安装
# Platform :RedHatEL7.x Based Platform
# Version :0.1
# Date :2022-09-16
# Author :mugoLH
# Contact :hxsaj@126.com
# Company :
# depend on:
# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
# 函数列表 List of common functions
########## ########## ########## ########## ########## ########## #
# ==> 提示色彩函数
info_p() { printf "\e[32;40m%-8s %-12s %-34s %-24s %-12s\e[0m\n" "$(date +'%Y%m%d %T')" "${1}" "${2}" "${3}" "${4}" >&1 ;}
echo_p(){ printf "\e[1;36;40m%-10s\e[0m \e[1;32;40m%-1s %-30s%-1s\e[0m" "$(date '+%y%m%d_%H:%M:%S')" "Step:" "${1}" ":" >&1 ;}
warning() { echo -e "\e[1;34m$(date +'%Y%m%d %T') $@ \e[0m" >&1 ; }
warning_p(){ printf "\e[1;33;40m%-8s %-12s %-34s %-24s %-12s\e[0m\n" "$(date +'%Y%m%d %T')" "${1}" "${2}" "${3}" "${4}" >&1 ;}
error_p() { printf "\e[1;35;40m%-8s %-12s %-34s %-24s %-12s\e[0m\n" "$(date +'%Y%m%d %T')" "${1}" "${2}" "${3}" "${4}" >&1 ;}
# ==> 关闭并禁用selinux
function selinux_off() {
# 步骤
echo_p "Disable Selinux"
# 执行
if [[ $(getenforce) = "Enforcing" ]]; then
setenforce 0 >/dev/null 2>&1
fi
if [ $(grep "^SELINUX=" /etc/selinux/config | awk -F "=" '{print$2}') != "disabled" ];then
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
info_p "[ SUCCESS ]" "Selinux disable successfully"
return 0
else
info_p "[ STATUS ]" "Disabled"
return 0
fi
}
# ==> 初始化部署环境
function init_env() {
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/hxsaj/tools_shell.git
git@gitee.com:hxsaj/tools_shell.git
hxsaj
tools_shell
tools_shell
master

搜索帮助