centos 常用工具安装脚本

########################################################################
# File Name: BasicTools.sh
# Author: dinmin
# mail: 103482702@qq.com
# Created Time: 2021年11月30日 星期二 10时50分59秒
#########################################################################
#!/bin/bash
TOOLS=""
function mainmenu(){
cat << EOF
+---------------------------------------------------------------------------------+
|                               1.参数化安装常用工具                              |
|                               2.系统组安装软件                                  |
|                               3.一键安装全部常用工具                            |
+---------------------------------------------------------------------------------+
EOF
read -p "请输入工具安装方式" para
case $para in
    1) parainstall
        ;;
    2) groupinstall
        ;;
    3) allinstall
        ;;
esac
}
function parainstall(){
cat << EOF
+----------------------------------------------------------------------------------+
|                                 参数说明                                         |
|                           1.tree-以树开结构显示文件目录                          |
|                           2.nmap-扫描端口的工具                                  |
|                           3.dos2unix-转换脚本格式的工具                          |
|                           4.lrzsz-上传下载文件工具                               |
|                           5.nc-文件传输、端口检查工具                            |
|                           6.lsof-反查端口进程,以及服务开发文件工具              |
|                           7.wget-下载欠缺包工具                                  |
|                           8.tcpdump-抓包、监听等重要排错工具                     |
|                           9.htop-系统进程相关信息查看工具                        |
|                           10.iftop-查看主机网卡带宽工具                          |
|                           11.sysstat-sar\iostat等重要系统性能工具                |
|                           12.nethogs-显示进程的网络流量                          |
|                           13.psmisc-含有killall、pstree等命令                    |
|                           14.net-tools-含有netstat、ifconfig、route、arp命令     |
|                           15.bash-completion-tab补全功能工具包                   |
|                           16.vim-enhanced-vim编辑器工具包                        |
|                           17.zlib-zlib库提了很多种压缩和解压缩的方式             |
|                           18.openssl-安全套接字层密码库                          |
+----------------------------------------------------------------------------------+
EOF
read -p "请输入您要安装的工具命令" comm
if [ -n $comm ]
then
    yum install $comm -y
else
    echo "您输入的工具命令为空,请重新输入!"
    exit 1
fi
}
function groupinstall(){
cat << EOF
+----------------------------------------------------------------------------------+
|                                  安装组列表                                      |
|                               1.Minimal Install                                  |
|                               2.Compute Node                                     |
|                               3.Infrastructure Server                            |
|                               4.File and Print Server                            |
|                               5.Cinnamon Desktop                                 |
|                               6.MATE Desktop                                     |
|                               7.Basic Web Server                                 |
|                               8.Virtualization Host                              |
|                               9.Server with GUI                                  |
|                               10.GNOME Desktop                                   |
|                               11.KDE Plasma Workspaces                           |
|                               12.Development and Creative Workstation            |
+----------------------------------------------------------------------------------+
EOF
read -p "请输入要安装的组列表" groupid
if [ -n $groupid ]
then
    case $groupid in
        1) yum groupinstall "Minimal Install" -y
            ;;
        2) yum groupinstall "Compute Node" -y
            ;;
        3) yum groupinstall "Infrastructure Server" -y
            ;;
        4) yum groupinstall "File and Print Server" -y
            ;;
        5) yum groupinstall "Cinnamon Desktop" -y
            ;;
        6) yum groupinstall "MATE Desktop" -y
            ;;
        7) yum groupinstall "Basic Web Server" -y
            ;;
        8) yum groupinstall "Virtualization Host" -y
            ;;
        9) yum groupinstall "Server with Gui" -y
            ;;
        10) yum groupinstall "GNOME Desktop" -y
            ;;
        11) yum groupinstall "KDE Plasma Workspaces" -y
            ;;
        12) yum groupinstall "Development and Creative Workstation" -y
            ;;
    esac
else
    echo "请正确输入安装组列表序号!"
fi
}
function allinstall(){
yum install tree nmap dos2unix lrzsz nc lsof wget tcpdump htop iftop iotop sysstat nethogs psmisc net-tools bash-completion vim-enhanced vmstat openssl openssl-devel pcre pcre-devel gcc-c++ -y
}
mainmenu

 

posted @ 2021-12-23 13:23  清风6661  阅读(283)  评论(0)    收藏  举报