Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
deploy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Script
deploy
Commits
326a7211
Commit
326a7211
authored
Feb 24, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
环境变量修改
parent
95e4dad2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
init.py
init.py
+1
-1
set_env.py
set_env.py
+14
-11
No files found.
init.py
View file @
326a7211
...
...
@@ -5,7 +5,7 @@ from set_proxy import set_linux_global_proxy, set_docker_service_proxy, set_doce
set_gitlab_runner_git_proxy
if
__name__
==
"__main__"
:
HSCUSCODE
,
ip_and_port
=
init_env
()
HSCUSCODE
=
init_env
()
# set_linux_global_proxy(ip_and_port)
#
...
...
set_env.py
View file @
326a7211
...
...
@@ -23,19 +23,22 @@ def init_env():
print
(
HSDB_USER
)
HSDB_PASSWORD
=
input
(
"请输入数据库密码HSDB_PASSWORD:"
)
print
(
HSDB_PASSWORD
)
HSDB_NAME
=
input
(
"请输入ERP数据库名称HSDB_NAME(默认HsGmtERP):"
)
print
(
HSDB_NAME
)
#
HSDB_NAME = input("请输入ERP数据库名称HSDB_NAME(默认HsGmtERP):")
#
print(HSDB_NAME)
MESDB_NAME
=
input
(
"请输入MES数据库名称MESDB_NAME(默认HsGmtMES):"
)
if
MESDB_NAME
==
''
:
MESDB_NAME
=
'HsGmtMES'
print
(
MESDB_NAME
)
HSDB_NAME
=
MESDB_NAME
HSPASSWORD
=
"huansi.net"
is_proxy
=
input
(
"是否设置代理,确认请输入Y,输入N不设置代理:"
)
if
is_proxy
.
upper
()
==
'Y'
:
ip_and_port
=
input
(
"请输入代理的ip地址和端口(列如192.168.1.1:808):"
)
.
strip
()
# CCProxy代理默认端口808
if
":"
not
in
ip_and_port
:
ip_and_port
=
ip_and_port
+
":808"
else
:
ip_and_port
=
None
#
is_proxy = input("是否设置代理,确认请输入Y,输入N不设置代理:")
#
if is_proxy.upper() == 'Y':
#
ip_and_port = input("请输入代理的ip地址和端口(列如192.168.1.1:808):").strip()
#
# CCProxy代理默认端口808
#
if ":" not in ip_and_port:
#
ip_and_port = ip_and_port + ":808"
#
else:
#
ip_and_port = None
env
=
dict
(
HSCUSCODE
=
HSCUSCODE
,
HSDB_HOST
=
HSDB_HOST
,
...
...
@@ -55,7 +58,7 @@ def init_env():
print
(
'环境变量设置成功,目标文件为/etc/profile.d/huansi.sh'
)
# 返回客户编号和代理地址
return
HSCUSCODE
,
ip_and_port
return
HSCUSCODE
elif
flag
==
"N"
:
continue
else
:
...
...
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