linux-tutorial/codes/linux/dunwu-sys.sh

62 lines
1.6 KiB
Bash
Raw Normal View History

2019-05-08 17:13:04 +08:00
#!/usr/bin/env bash
2019-10-24 22:00:00 +08:00
# ---------------------------------------------------------------------------------
# 控制台颜色
BLACK="\033[1;30m"
RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
PURPLE="\033[1;35m"
CYAN="\033[1;36m"
RESET="$(tput sgr0)"
# ---------------------------------------------------------------------------------
2019-05-08 17:13:04 +08:00
2019-10-24 22:00:00 +08:00
printf "${BLUE}\n"
cat << EOF
2019-05-08 17:13:04 +08:00
###################################################################################
2019-10-24 22:00:00 +08:00
# 欢迎使用 Dunwu Shell 环境初始化脚本(设置环境配置、安装基本的命令工具)
# 适用于 Linux CentOS 环境
2019-05-08 17:13:04 +08:00
# @author: Zhang Peng
###################################################################################
EOF
2019-10-24 22:00:00 +08:00
printf "${RESET}\n"
2019-05-08 17:13:04 +08:00
2019-10-10 08:56:31 +08:00
menus=( "替换yum镜像" "安装基本的命令工具" "安装常用libs" "系统配置" "全部执行" "退出" )
2019-05-08 17:13:04 +08:00
main() {
2019-10-29 18:22:19 +08:00
PS3="请输入命令编号:"
select item in "${menus[@]}"
do
case ${item} in
"替换yum镜像")
sh ${path}/sys/change-yum-repo.sh
main ;;
"安装基本的命令工具")
sh ${path}/sys/install-tools.sh
main ;;
"安装常用libs")
sh ${path}/sys/install-libs.sh
main ;;
"系统配置")
sh ${path}/sys/sys-settings.sh ${path}/sys
main ;;
"全部执行")
sh ${path}/sys/change-yum-repo.sh
sh ${path}/sys/install-tools.sh
sh ${path}/sys/install-libs.sh
sh ${path}/sys/sys-settings.sh ${path}/sys
printf "${GREEN}执行完毕,退出。${RESET}\n" ;;
"退出")
exit 0 ;;
*)
printf "${RED}输入项不支持!${RESET}\n"
main ;;
esac
break
done
2019-05-08 17:13:04 +08:00
}
######################################## MAIN ########################################
2019-10-29 18:22:19 +08:00
path=$(pwd)
2019-05-08 17:13:04 +08:00
main