做了个iftop的安装脚本,希望看到的能派上用场.iftop的说明和使用请参看:
直接上脚本,脚本里面用说明哦,哈哈,比较粗糙...
#!/bin/bashecho "正在检查安装系统依赖包,请稍等......"yum install -y gcc gcc-c++ libpcap libpcap-devel ncurses ncurses-devel flex byaccecho "正在下载iftop主程序包......"DOWNLOAD=/usr/local/src/cd ${DOWNLOAD}wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gzecho "正在解压和编译iftop主程序包...."tar zxvf iftop-0.17.tar.gz cd iftop-0.17./configure echo "请选择安装 继续安装 请输入Y\y 退出 请输入N\n"read -p "请根据编号选择(Y\y or N\n).. " SERVER_IDif [ $SERVER_ID == Y ] || [ $SERVER_ID == y ];then SERVER="继续安装"elif [ $SERVER_ID == N ] || [ $SERVER_ID == n ];then SERVER="Quit" exit 5else exitfiecho "安装正在进行中,请稍等...."make && make install echo "安装成功,请使用......"