Commit 326a7211 authored by 金凯强's avatar 金凯强 🎨

环境变量修改

parent 95e4dad2
...@@ -5,7 +5,7 @@ from set_proxy import set_linux_global_proxy, set_docker_service_proxy, set_doce ...@@ -5,7 +5,7 @@ from set_proxy import set_linux_global_proxy, set_docker_service_proxy, set_doce
set_gitlab_runner_git_proxy set_gitlab_runner_git_proxy
if __name__ == "__main__": if __name__ == "__main__":
HSCUSCODE, ip_and_port = init_env() HSCUSCODE = init_env()
# set_linux_global_proxy(ip_and_port) # set_linux_global_proxy(ip_and_port)
# #
......
...@@ -23,19 +23,22 @@ def init_env(): ...@@ -23,19 +23,22 @@ def init_env():
print(HSDB_USER) print(HSDB_USER)
HSDB_PASSWORD = input("请输入数据库密码HSDB_PASSWORD:") HSDB_PASSWORD = input("请输入数据库密码HSDB_PASSWORD:")
print(HSDB_PASSWORD) print(HSDB_PASSWORD)
HSDB_NAME = input("请输入ERP数据库名称HSDB_NAME(默认HsGmtERP):") # HSDB_NAME = input("请输入ERP数据库名称HSDB_NAME(默认HsGmtERP):")
print(HSDB_NAME) # print(HSDB_NAME)
MESDB_NAME = input("请输入MES数据库名称MESDB_NAME(默认HsGmtMES):") MESDB_NAME = input("请输入MES数据库名称MESDB_NAME(默认HsGmtMES):")
if MESDB_NAME == '':
MESDB_NAME = 'HsGmtMES'
print(MESDB_NAME) print(MESDB_NAME)
HSDB_NAME = MESDB_NAME
HSPASSWORD = "huansi.net" HSPASSWORD = "huansi.net"
is_proxy = input("是否设置代理,确认请输入Y,输入N不设置代理:") # is_proxy = input("是否设置代理,确认请输入Y,输入N不设置代理:")
if is_proxy.upper() == 'Y': # if is_proxy.upper() == 'Y':
ip_and_port = input("请输入代理的ip地址和端口(列如192.168.1.1:808):").strip() # ip_and_port = input("请输入代理的ip地址和端口(列如192.168.1.1:808):").strip()
# CCProxy代理默认端口808 # # CCProxy代理默认端口808
if ":" not in ip_and_port: # if ":" not in ip_and_port:
ip_and_port = ip_and_port + ":808" # ip_and_port = ip_and_port + ":808"
else: # else:
ip_and_port = None # ip_and_port = None
env = dict(HSCUSCODE=HSCUSCODE, env = dict(HSCUSCODE=HSCUSCODE,
HSDB_HOST=HSDB_HOST, HSDB_HOST=HSDB_HOST,
...@@ -55,7 +58,7 @@ def init_env(): ...@@ -55,7 +58,7 @@ def init_env():
print('环境变量设置成功,目标文件为/etc/profile.d/huansi.sh') print('环境变量设置成功,目标文件为/etc/profile.d/huansi.sh')
# 返回客户编号和代理地址 # 返回客户编号和代理地址
return HSCUSCODE, ip_and_port return HSCUSCODE
elif flag == "N": elif flag == "N":
continue continue
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment