Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
tingweiwang
/
machine-init
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 59cbcf41
authored
Jan 09, 2020
by
wangtingwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
1 parent
e6f8ea3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
machine-init.sh
machine-init.sh
View file @
59cbcf4
...
@@ -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
}
}
####################################################################################
####################################################################################
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment