Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangkx1
harbor
Commits
9d806e4c
Commit
9d806e4c
authored
Oct 20, 2024
by
wangkx1
Browse files
Add new file
parent
5e222062
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
solve_ca_node2.sh
solve_ca_node2.sh
+32
-0
No files found.
solve_ca_node2.sh
0 → 100644
View file @
9d806e4c
#!/bin/bash
# 1. 添加 10.17.30.230 hygon.ai.com 到 /etc/hosts 文件的末尾
HOST_ENTRY
=
"10.17.27.218 dcu.ai.com"
HOSTS_FILE
=
"/etc/hosts"
if
!
grep
-q
"
$HOST_ENTRY
"
"
$HOSTS_FILE
"
;
then
echo
"
$HOST_ENTRY
"
|
sudo tee
-a
"
$HOSTS_FILE
"
echo
"已添加
$HOST_ENTRY
到
$HOSTS_FILE
"
else
echo
"
$HOST_ENTRY
已存在于
$HOSTS_FILE
中"
fi
# 2. 从远程服务器下载 harbor.crt 文件
REMOTE_USER
=
"root"
REMOTE_HOST
=
"10.17.27.218"
REMOTE_PATH
=
"/home/harbor/key/dcu.crt"
LOCAL_PATH
=
"/etc/ssl/certs/"
echo
"如需使用, 请私聊索要密码"
scp
"
$REMOTE_USER
@
$REMOTE_HOST
:
$REMOTE_PATH
"
"
$LOCAL_PATH
"
if
[
$?
-eq
0
]
;
then
echo
"文件已成功下载到
$LOCAL_PATH
"
else
echo
"文件下载失败"
fi
# sudo update-ca-certificates
echo
"Please do as follows so that you can start enjoying using harbor"
echo
"1. sudo systemctl daemon-reload"
echo
"2. sudo systemctl restart docker"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment