Commit 59cbcf41 by wangtingwei

fix bug

1 parent e6f8ea3a
Showing with 12 additions and 11 deletions
...@@ -5,12 +5,12 @@ local_ip=192.168.1.93 ...@@ -5,12 +5,12 @@ local_ip=192.168.1.93
nfs_disk= nfs_disk=
data_disk=/dev/sdb data_disk=/dev/sdb
data_mount_path=/data data_mount_path=/data
##################################################不常改变的变量############################## ########################################不常改变的变量##############################
repo_ip=192.168.1.145 repo_ip=192.168.1.145
repo_host=apt.offline.com repo_host=apt.offline.com
end_ip=`echo $local_ip |awk -F "." '{print $4}'` end_ip=`echo $local_ip |awk -F "." '{print $4}'`
root_passwd=seetatech root_passwd=seetatech
##################################################基础函数###################################3 ########################################################################################
base() { base() {
echo "设置修改内网apt源" echo "设置修改内网apt源"
sleep 2 sleep 2
...@@ -34,8 +34,8 @@ rm -rf /etc/resolv.conf && echo "nameserver 114.114.114.114" >>/etc/resolv.conf ...@@ -34,8 +34,8 @@ rm -rf /etc/resolv.conf && echo "nameserver 114.114.114.114" >>/etc/resolv.conf
mount_data() { mount_data() {
read -p "挂载data的数据盘如果超过2T、请输入parted、否则输入fdisk:" partition_method read -p "挂载data的数据盘如果超过2T、请输入parted、否则输入fdisk:" partition_method
if [ $partition_method = "fdisk" ];then if [ $partition_method = "fdisk" ];then
echo "使用fdisk方法分区" echo "使用fdisk方法分区"
fdisk $data_disk fdisk $data_disk
else else
echo "使用parted方法分区" echo "使用parted方法分区"
parted $data_disk parted $data_disk
...@@ -67,27 +67,28 @@ hostname seetaas-cpu-$end_ip ...@@ -67,27 +67,28 @@ hostname seetaas-cpu-$end_ip
echo "seetaas-cpu-$end_ip" >>/etc/hostname echo "seetaas-cpu-$end_ip" >>/etc/hostname
echo "设置本机hosts" echo "设置本机hosts"
echo "$local_ip seetaas-cpu-$end_ip" >>/etc/hosts echo "$local_ip seetaas-cpu-$end_ip" >>/etc/hosts
echo "#########################执行挂载数据盘操作############################" echo "执行挂载数据盘操作"
mount_data sleep 1
mount_data
} }
gpu() { gpu() {
base base
echo "#################设置本机主机名#############################################" echo "设置本机主机名"
hostname seetaas-gpu-$end_ip hostname seetaas-gpu-$end_ip
echo "seetaas-gpu-$end_ip" >>/etc/hostname echo "seetaas-gpu-$end_ip" >>/etc/hostname
echo "#################设置本机hosts#############################################" echo "设置本机hosts"
echo "$local_ip seetaas-gpu-$end_ip" >>/etc/hosts echo "$local_ip seetaas-gpu-$end_ip" >>/etc/hosts
echo "#########################执行挂载数据盘操作#######################" echo "执行挂载数据盘操作"
mount_data mount_data
} }
storage() { storage() {
base base
echo "#################设置本机主机名#############################################" echo "设置本机主机名"
hostname seetaas-storage-$end_ip hostname seetaas-storage-$end_ip
echo "seetaas-storage-$end_ip" >>/etc/hostname echo "seetaas-storage-$end_ip" >>/etc/hostname
echo "#################设置本机hosts#############################################" echo "设置本机hosts"
echo "$local_ip seetaas-storage-$end_ip" >>/etc/hosts echo "$local_ip seetaas-storage-$end_ip" >>/etc/hosts
} }
#################################################################################### ####################################################################################
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!