自动化1
2016-07-22 18:59
85 查看
#!/bin/bash
02.echo "New system configuration"
03.sleep 1
04.echo "Environment RHEL6.3"
05.sleep 1
06.echo "The kernel version configuration!"
07.sleep 1
08.echo "Designed by www.rsyslog.org http://dreamfire.blog.51cto.com" 09.sleep 1
10.input_fun() //定义一个可以重复输入的函数(空值回车情况下 也可用参考http://dreamfire.blog.51cto.com/418026/1152672)
11.{
12. OUTPUT_VAR=$1
13. INPUT_VAR=""
14. while [ -z $INPUT_VAR ];do
15. read -p "$OUTPUT_VAR" INPUT_VAR
16. done
17. echo $INPUT_VAR
18.}
19.
20.input_again() //定义网络参数函数,交互式读取输入.
21.{
22.MYHOSTNAME=$( input_fun "Please input the hostname: ")
23.DOMAINNAME=$( input_fun "Please intput the domainname(rsyslog.org): ")
24.CARD_TYPE=$( input_fun "Please input card type(eth0): ")
25.IPADDR=$( input_fun "Please input ipaddress(192.168.100.1): ")
26.NETMASK=$( input_fun "Please input netmask(255.255.255.0): ")
27.GATEWAY=$( input_fun "Please input gateway(192.168.100.1): ")
28.MYDNS1=$( input_fun "Please input DNS1(192.168.100.102): ")
29.MYDNS2=$( input_fun "Please input DNS2(192.168.100.103): ")
02.echo "New system configuration"
03.sleep 1
04.echo "Environment RHEL6.3"
05.sleep 1
06.echo "The kernel version configuration!"
07.sleep 1
08.echo "Designed by www.rsyslog.org http://dreamfire.blog.51cto.com" 09.sleep 1
10.input_fun() //定义一个可以重复输入的函数(空值回车情况下 也可用参考http://dreamfire.blog.51cto.com/418026/1152672)
11.{
12. OUTPUT_VAR=$1
13. INPUT_VAR=""
14. while [ -z $INPUT_VAR ];do
15. read -p "$OUTPUT_VAR" INPUT_VAR
16. done
17. echo $INPUT_VAR
18.}
19.
20.input_again() //定义网络参数函数,交互式读取输入.
21.{
22.MYHOSTNAME=$( input_fun "Please input the hostname: ")
23.DOMAINNAME=$( input_fun "Please intput the domainname(rsyslog.org): ")
24.CARD_TYPE=$( input_fun "Please input card type(eth0): ")
25.IPADDR=$( input_fun "Please input ipaddress(192.168.100.1): ")
26.NETMASK=$( input_fun "Please input netmask(255.255.255.0): ")
27.GATEWAY=$( input_fun "Please input gateway(192.168.100.1): ")
28.MYDNS1=$( input_fun "Please input DNS1(192.168.100.102): ")
29.MYDNS2=$( input_fun "Please input DNS2(192.168.100.103): ")
相关文章推荐
- centos 手动安装网卡驱动
- Windows7下获得System权限问题解决方法
- 安装软件 Nullsoft Install System 2.27汉化版 下载
- Could not load type System.ServiceModel.Activation.HttpModule解决办法
- PHP 命令行工具 shell_exec, exec, passthru, system详细使用介绍
- oracle忘记sys/system/scott用户密码的解决方法
- Oracle中sys和system用户、系统权限和角色的区别
- Oracle中sys和system的区别小结
- System Repair Engineer (SREng) 功能介绍与下载
- Office 2007 System 常见问题集第1/3页
- php中使用exec,system等函数调用系统命令的方法(不建议使用,可导致安全问题)
- Display SQL Server Version Information
- 关于Unsupported major.minor version 49.0的错误解决办法
- System 类 和 Runtime 类的常用用法介绍
- awk中让人郁闷的system()函数
- PHP中exec与system用法区别分析
- PHP启动windows应用程序、执行bat批处理、执行cmd命令的方法(exec、system函数详解)
- 无法读取配置节 system.serviceModel 因为它缺少节声明的解决方法
- PHP 执行系统外部命令 system() exec() passthru()
- WAC启动Android模拟器 transfer error: Read-only file system错误解决方法