代码拉取完成,页面将自动刷新
#!/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() {
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。