2019-05-08 17:13:04 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
###################################################################################
|
|
|
|
# Linux CentOS 环境初始化脚本(设置环境配置、安装基本的命令工具)
|
|
|
|
# @author: Zhang Peng
|
|
|
|
###################################################################################
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
menus=("替换yum镜像" "安装基本的命令工具" "安装常用libs" "系统配置" "全部执行" "退出")
|
|
|
|
main() {
|
|
|
|
PS3="请输入命令编号:"
|
|
|
|
select item in ${menus[@]}
|
|
|
|
do
|
|
|
|
case ${item} in
|
|
|
|
"替换yum镜像")
|
2019-05-16 11:49:19 +08:00
|
|
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/change-yum-repo.sh | bash
|
2019-05-08 17:13:04 +08:00
|
|
|
main ;;
|
|
|
|
"安装基本的命令工具")
|
2019-05-16 11:49:19 +08:00
|
|
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-tools.sh | bash
|
2019-05-08 17:13:04 +08:00
|
|
|
main ;;
|
|
|
|
"安装常用libs")
|
2019-05-16 11:49:19 +08:00
|
|
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-libs.sh | bash
|
2019-05-08 17:13:04 +08:00
|
|
|
main ;;
|
|
|
|
"系统配置")
|
2019-05-16 11:49:19 +08:00
|
|
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/sys-settings.sh | bash
|
2019-05-08 17:13:04 +08:00
|
|
|
main ;;
|
|
|
|
"全部执行")
|
2019-05-16 11:49:19 +08:00
|
|
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/change-yum-repo.sh | bash
|
|
|
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-tools | bash
|
|
|
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/install-libs.sh | bash
|
|
|
|
curl -o- https://gitee.com/turnon/linux-tutorial/raw/master/codes/linux/sys/sys-settings.sh | bash
|
2019-05-08 17:13:04 +08:00
|
|
|
printf "执行完毕,退出。\n" ;;
|
|
|
|
"退出")
|
|
|
|
exit 0 ;;
|
|
|
|
*)
|
|
|
|
printf "输入项不支持!\n"
|
|
|
|
main ;;
|
|
|
|
esac
|
|
|
|
break
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
######################################## MAIN ########################################
|
|
|
|
main
|