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 d6958b33
authored
Jan 07, 2020
by
wangtingwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix自动挂载
1 parent
192bbef3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
machine-init.sh
machine-init.sh
View file @
d6958b3
#!/bin/bash
#!/bin/bash
#王庭威
#王庭威
#2020/1/7
#2020/1/7
local_ip
=
192.168.1
37.200
local_ip
=
192.168.1
.93
nfs_disk
=
nfs_disk
=
data_disk
=
/dev/sd
b
data_disk
=
/dev/sd
i
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
$
repo
_ip
|awk -F
"."
'{print $4}'
`
end_ip
=
`
echo
$
local
_ip
|awk -F
"."
'{print $4}'
`
##################################################基础函数###################################3
##################################################基础函数###################################3
base
()
{
base
()
{
echo
"##################设置修改内网apt源############################################"
echo
"##################设置修改内网apt源############################################"
...
@@ -43,10 +43,10 @@ mkdir $data_mount_path
...
@@ -43,10 +43,10 @@ mkdir $data_mount_path
echo
"#########################挂载数据盘到挂载点#########################"
echo
"#########################挂载数据盘到挂载点#########################"
mount
${
data_disk
}
1
$data_mount_path
mount
${
data_disk
}
1
$data_mount_path
echo
"##########################根据UUID设置自动挂载######################"
echo
"##########################根据UUID设置自动挂载######################"
uuid
=
`
blkid |grep
{
data_disk
}
1 |awk -F
'"'
'{print $2}'
`
uuid
=
`
blkid |grep
$
{
data_disk
}
1 |awk -F
'"'
'{print $2}'
`
echo
"uuid值为
$uuid
"
echo
"uuid值为
$uuid
"
echo
"{data_disk}1"
echo
"
$
{
data_disk
}
1"
echo
"UUID
\
=
$uuid
$data_mount_path
ext4 defaults 0 0"
>>/etc/fstab
echo
"UUID=
$uuid
$data_mount_path
ext4 defaults 0 0"
>>/etc/fstab
}
}
#########################################上层函数##################################
#########################################上层函数##################################
cpu
()
{
cpu
()
{
...
...
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