yum自动脚本
echo -e "\033[34mstop server:\033[0m"
service iptables stop
service NetworkManager stop
chkconfig --del iptables
chkconfig --del NetworkManager
setenforce 0
cat /etc/redhat-release | cut -d' ' -f3 | cut -d. -f1 >/so.txt
#read -p "Input source.1/2/3:" MI
if [ $(cat /so.txt) -eq 6 ];then
cd /etc/yum.repos.d/
[ -f /etc/yum.repos.d/CentOS-Base.repo ] && mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && echo "backup local source OK!"
[ -f /etc/yum.repos.d/CentOS6-Base.repo ] && echo "yum source exist" && yum list && exit 4
[ ! -f /etc/yum.repos.d/CentOS6-Base.repo ] && wget http://10.56.126.75/.help/CentOS6-Base.repo
[ -f /etc/yum.repos.d/CentOS6-Base.repo ] && yum clean all &>/dev/null && echo "Clean Yum cache OK" || echo "Loading error."
yum makecache
yum list
rm -rf /so.txt
elif [ $(cat /so.txt) -eq 7 ];then
cd /etc/yum.repos.d/
[ -f /etc/yum.repos.d/CentOS-Base.repo ] && mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && echo "backup local source OK!"
[ -f /etc/yum.repos.d/CentOS7-Base.repo ] && echo "yum source exist" && exit 4
[ ! -f /etc/yum.repos.d/CentOS7-Base.repo ] && wget http://10.56.126.75/.help/CentOS7-Base.repo
[ -f /etc/yum.repos.d/CentOS7-Base.repo ] && yum clean all &>/dev/null && echo "Clean Yum cache OK" || echo "Loading error." && exit 4
echo "please waiting..."
yum makecahe
yum list
rm -rf /so.txt
elif [ $(cat /so.txt) -eq 5 ];then
[ -f /etc/yum.repos.d/CentOS-Base.repo ] && mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && echo "backup local source OK!"
[ -f /etc/yum.repos.d/CentOS5-Base.repo ] && echo "yum source exist" && yum list && exit 4
[ ! -f /etc/yum.repos.d/CentOS5-Base.repo ] && wget http://10.56.126.75/.help/CentOS5-Base.repo
[ -f /etc/yum.repos.d/CentOS5-Base.repo ] && yum clean all &>/dev/null && echo "Clean Yum cache OK" || echo "Loading error."
yum makecache
yum list
rm -rf /so.txt else
echo "error option"
exit 4
fi
yum自动脚本的更多相关文章
- 无密钥登录的自动脚本实现(ssh-copy-id、expect免交互输入脚本)
感谢朋友支持本博客,欢迎共同探讨交流,由于能力和时间有限,错误之处在所难免,欢迎指正! 如有转载,请保留源作者博客信息. Better Me的博客:blog.csdn.net/tantexian 如需 ...
- 让CentOS能用yum自动安装rar和unrar
目的:让CentOS能用yum自动安装rar和unrar 系统环境: CentOS 7.0 具体操作步骤如下: 1.编辑文件 编辑dag.repo文件,或者说是新建一个dag.repo文件. vi / ...
- 自动脚本工具新版 v2.0
自动脚本工具 下载 下载工具后,解压,直接双击 "execute.bat" 文件后(前提已配置好 jdk 1.7 的环境),会生成文件夹 "output",该文 ...
- showdoc 自动脚本安装
========================== showdoc 简介==========================在线文档管理系统很多, 比如阿里的语雀.腾讯的 TAPD 平台也包括文档管 ...
- CentOS 7系统关闭yum自动下载更新
安装CentOS 7后,系统yum自动更新状态默认为开启,若禁止系统自动更新需要手动关闭. 1.进入yum目录 [root@localhost ~]$ cd /etc/yum 2.编辑yum-cron ...
- 解剖Nginx·自动脚本篇(6)编译器名称变量脚本 auto/cc/name
回顾变量 CC 最初是在auto/options脚本中初始化的: CC=${CC:-gcc} 1 C Compiler 的 feature Windows 平台的编译器叫做MSVC,其他平台的都统称为 ...
- 解剖Nginx·自动脚本篇(5)编译器相关主脚本
在 Nginx 的自动脚本中,auto/cc目录下的所有脚本都是用于编译器相关配置使用的.Nginx的出色跨平台性(Linux.Darwin.Solaris.Win32 等)就有这些脚本的贡献.该目录 ...
- 解剖Nginx·自动脚本篇(4)工具型脚本系列
目录 auto/have 向自动配置头文件追加可用宏定义(objs/ngx_auto_config.h) auto/nohave 向自动配置头文件追加不可用宏定义(objs/ngx_auto_conf ...
- 解剖Nginx·自动脚本篇(1)解析配置选项脚本 auto/options
在安装Nginx之前(即运行make脚本之前),首先是进行安装的配置准备,包括环境检查及生成文件.这些工作是由自动脚本完成的.和绝大多数软件一样,Nginx的自动脚本的入口,同样是名为configur ...
随机推荐
- Android IOS WebRTC 音视频开发总结(七五)-- WebRTC视频通信中的错误恢复机制
本文主要介绍WebRTC视频通信中的错误恢复机制(我们翻译和整理的,译者:jiangpeng),最早发表在[这里] 支持原创,转载必须注明出处,欢迎关注我的微信公众号blacker(微信ID:blac ...
- Hibernate day01笔记
框架体系结构 hibernate入门 ORM框架 Hibernate是一个数据持久化层的ORM框架. Object:对象,java对象,此处特指JavaBean Relational:关系,二维表 ...
- Reprot中的五个Trigger说明
Report Trigger 1.1 Which report trigger to use As a general rule, any processing that will affect th ...
- Java2OP
Java2OP D:\Program Files (x86)\Embarcadero\Studio\18.0\bin\converters\java2op\Java2OP.exe Java2OP.ex ...
- TStringList TMemo Text与Add赋值的区别 Memo.Text赋值高度注意事项,不得不知的技巧。
Memo.Text赋值高度注意事项,不得不知的技巧. list := TStringList.Create; list.Text:= str: list.Count; list.Clear; l ...
- MFC CFileDialog用法例子。
Set it to TRUE to construct a File Open dialog box. Set it to FALSE to construct a File Save As dia ...
- EXTJS 4 动态grid
var grid=Ext.getCmp("GridPanel1"); var store = grid.getStore(); Ext.Ajax.request({ url:&qu ...
- 用window.showModelDialog() 打开的页面的返回值
有两个页面也个 Default1.aspx 另外一个是 Default2.aspx Default1.aspx 有个按钮是用来打开Default2.aspx页面的 按钮的js代码是 var win ...
- 关于form验证的处理片断
public virtual void SignIn(s_User user, bool createPersistentCookie) { var now = DateTime.UtcNow.ToL ...
- UIScrollViewDelegate
一.执行顺序:(scrollView加后面的)willBeginDragging // 将要开始拖拽,手指已经放在view上并准备拖动的那一刻 DidScroll ...