#!/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): ")
自動化1
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
nagios學習手札
3543772
2019-02-23 13:51:43
關於System Volume Information佔用的大量磁盤空間
781732825
2019-02-23 13:39:40
利用RAID保護數據
Aslfe
2019-02-23 13:05:53
電腦機箱保養常識
shenjianyangui
2019-02-23 13:02:24
Centos7 修改運行級別
wxl_xiao5
2019-02-23 00:42:28
linux系統啓動流程
戰狼戰神
2019-02-23 00:40:06
sp_configure錯誤:不支持對系統目錄進行即席更新。
wwdyl321
2019-02-23 00:25:44
e.printStackTrace()和System.out.print(e)的區別
albany
2019-02-23 00:17:01
centos ***
samplelife
2019-02-23 13:57:36
交換機的基本配置實驗報告
乘風來
2019-02-23 13:00:59
交換機的基本配置實驗報告
1406404037
2019-02-23 12:50:57