centos自动安装镜像脚本
#!/bin/bash
###########################################################################################################################author:wen.lu
#email:
##########################################################################################################################
####parameters: Cdrom_name_dir Ks_name_dir Tmp_dir Mount_dir auto_cd()
{
Cdrom_name_dir=/home/remotecard/RHEL6.4_X86_64_AutoInstall_DVD_`date +'%Y%m%d'`.iso
Source_file=/home/remotecard/rhel-server-6.4-x86_64-dvd.iso
Ks_name_dir=ks.cfg
Tmp_dir=/tmp/rhel6.
Label=RHEL6.4_X86_64_AutoInstall_DVD
Mount_dir=/mnt
if [ -d ${Tmp_dir} ]
then
echo " Tmp_dir is exits"
else
mkdir ${Tmp_dir} &> /dev/null
fi
mount ${Source_file} -o loop ${Mount_dir} &> /dev/null
cp -a ${Mount_dir}/. ${Tmp_dir}
###create file isolinux.cfg
mv ${Tmp_dir}/isolinux/isolinux.cfg /isolinux.cfg.bak &> /dev/null
cat << EOF >> ${Tmp_dir}/isolinux/isolinux.cfg
default install
prompt
#timeout
timeout display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label install
kernel vmlinuz
append ks=cdrom:/ks.cfg initrd=initrd.img
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label Boot from ^local drive
localboot 0xffff
label memtest86
menu label ^Memory test
kernel memtest
append -
EOF
umount ${Mount_dir}
cp ${Ks_name_dir} ${Tmp_dir}
cd ${Tmp_dir}
find -type f -name "TRANS.TBL" |xargs rm -f
rm -rf isolinux/boot.cat
chmod +w isolinux/* &> /dev/null
###create iso file
mkisofs -o ${Cdrom_name_dir} -J -r -v\
-b isolinux/isolinux.bin\
-c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table\
-V "$Label" .
implantisomd5 --force ${Cdrom_name_dir} &>/dev/null
if (( $? == 0 ))
then
rm -rf ${Tmp_dir}
echo "cdrom is ok"
else
rm -rf ${Tmp_dir}
echo "cdrom is wrong"
fi
}
auto_cd
centos自动安装镜像脚本的更多相关文章
- 实用脚本----Linux下Jdk和Tomcat自动安装shell脚本总结
系统环境为:ubuntu 14.04 一.JDK 自动安装脚本 jdk自动安装bash shell脚本,截止今天(2014/10/15)亲测可用: sudo su #切换到root权限 mkdir / ...
- hadoop自动安装的脚本与步骤
最近要在10几台机器上安装hadoop.对于这种繁复而重复的工作,一步步的打命令行,对于程序员来说是一件不能忍的事情.所以我就琢磨着怎么写一个脚本来自动安装hadoop. 任务: 在10几台机器上中的 ...
- pgsql自动安装shell脚本整理
前面不断在vm虚拟机上测试pgsql,发觉安装还是有些麻烦的. 所以就收集了一些 1,http://www.davidghedini.com/pg/entry/postgresql_9_5_scrip ...
- (转)CentOS一键安装Nginx脚本
原文:https://www.xiaoz.me/archives/10301 https://blog.slogra.com/post-676.html-----centos7一键安装nginx脚本
- Linux通用KVM自动安装Shell脚本(兼容所有Linux发行版/CentOS/Ubuntu)
官网: https://github.com/retspen/webvirtmgr/wiki/Setup-Host-Server 安装: wget -O - https://retspen.githu ...
- 自动安装zabbix_agent脚本 -- python2
#!/usr/bin/env python # -*- coding: utf-8 -*- import os ZABBIX_SERVER_IP='10.171.100.28' if os.path. ...
- CentOS自动化安装LAMP脚本
#!/bin/bash #-- #blog:lizhenliang.blog.51cto.com ########## function ########## depend_pkg () { yum ...
- 可以自动安装mysql数据库的一个shell脚本
发布:thatboy 来源:脚本学堂 [大 中 小] 分享一例shell脚本,可以实现mysql数据库的自动安装,脚本写的不错,无论是用来学习,还是生产环境中应用,都是不错的,有需要的朋友 ...
- Linux学习之源码包安装与脚本安装(十八)
Linux学习之源码包安装与脚本安装 目录 源码包与RPM包的区别 源码包安装 脚本安装 源码包与RPM包的区别 1.区别 安装之前的区别:概念上的区别 安装之后的区别:安装位置不同 源码包: 开源的 ...
随机推荐
- PSR-1 基础编码规范
本篇规范制定了代码基本元素的相关标准, 以确保共享的PHP代码间具有较高程度的技术互通性. 关键词 “必须”("MUST").“一定不可/一定不能”("MUST NOT& ...
- AC日记——小M的作物 bzoj 3438
3438 思路: 最小割(完全不懂看的题解): s向每个作物连边,s-x ai,x-t bi: 然后s向作物集合连边,cia: 作物集合拆点向t连边,cib: 作物集合第一个点向作物连边INF: 作物 ...
- 解决虚拟机安装tomcat主机访问不到
在wmware中安装linux后安装好数据库,JDK及tomcat后启动服务,虚拟机中可以访问,但是主机却无法访问,但是同时主机和虚拟机之间可以ping的通.解决方法是关闭虚拟机中的防火墙服务.桌面- ...
- iOS禁止多点操作(按钮和Table项)
1)避免同时点击多个按钮: [btn setExclusiveTouch:YES]; 设置确保当btn点击时,其他按钮不响应: (2)避免同时点击UITableView中多个row -(NSIndex ...
- Linux系统入门命令100条 转
https://www.howtoforge.com/linux-commands/ 2017-04-27 RiboseYim 睿哥杂货铺 Author : Himanshu Arora 原文:htt ...
- [Bug] 未找到导入的项目“C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets”
This is very easy to do. Open your build definition and go to the "Process" page. Then und ...
- 玩转shell之符号篇
转:http://hi.baidu.com/hellosimple/item/21b31dfefd23e811e2e3bd47 在shell中常用的特殊符号罗列如下: # ; ;; . , / \\ ...
- 在eclipse上部署openfire 3.9.1源码,並配置openfire
参考文章:https://my.oschina.net/u/1409622/blog/205603 在网上找了很久部署openfire源码的文章,由于我使用的是最新的3.9.1源码,试了很多种部署方法 ...
- 在Android中解决内存溢出 – OutOfMemoryError
原文链接:http://riggaroo.co.za/fixing-memory-leaks-in-android-outofmemoryerror/ 注:本文在原文基础上在如何判断内存是否泄露方面进 ...
- JAVA常见算法题(八)
package com.xiaowu.demo; /** * 求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字.例如2+22+222+2222+22222(此时共有5个数相加), ...