Skip to content

Commit

Permalink
bugfix: P-Agent无法连接外网时,安装失败的问题 (fixed #354)
Browse files Browse the repository at this point in the history
  • Loading branch information
CohleRustW authored and zhangzhw8 committed Dec 16, 2021
1 parent 4268dd0 commit 3c3b79c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions dev_log/2.1.360/xcwang_202112151826.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfix:
- "P-Agent无法连接外网时,安装失败的问题 (fixed #354)"
12 changes: 6 additions & 6 deletions script_tools/setup_pagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def arg_parser() -> argparse.ArgumentParser:
parser.add_argument("-HSN", "--host-script-name", type=str, help="Host Script Name")
parser.add_argument("-HS", "--host-shell", type=str, help="Host Shell")
parser.add_argument("-CPA", "--channel-proxy-address", type=str, help="Channel Proxy Address", default=None)
parser.add_argument("-ADP", "--agent-download-proxy", type=str, help="Agent Download Proxy", default=True)
parser.add_argument("-ADP", "--agent-download-proxy", type=bool, help="Agent Download Proxy", default=True)
return parser


Expand Down Expand Up @@ -377,9 +377,9 @@ def main() -> None:
f"rm -f {tmp_dir}{script_name}",
]
download_cmd = (
f"curl {args.download_url}/{script_name} -o {tmp_dir}{script_name} -sSf "
f"curl {args.download_url}/{script_name} -o {tmp_dir}{script_name} -sSf -x {http_proxy_url} "
if args.agent_download_proxy
else f"curl {args.download_url}/{script_name} -o {tmp_dir}{script_name} -sSf -x {http_proxy_url} "
else f"curl {args.download_url}/{script_name} -o {tmp_dir}{script_name} -sSf "
)
cmd.append(download_cmd)
cmd.append(
Expand Down Expand Up @@ -413,10 +413,10 @@ def main() -> None:
else:
cmd = [f"del /q /s /f {tmp_dir}{script_name} {tmp_dir}gsectl.bat"]
download_cmd = (
f"{tmp_dir}curl.exe {args.download_url}/{script_name} -o {tmp_dir}{script_name} -sSf "
f"{tmp_dir}curl.exe {args.download_url}/{script_name}"
f" -o {tmp_dir}{script_name} -sSf -x {http_proxy_url} "
if args.agent_download_proxy
else f"{tmp_dir}curl.exe {args.download_url}/{script_name}"
f"-o {tmp_dir}{script_name} -sSf -x {http_proxy_url} "
else f"{tmp_dir}curl.exe {args.download_url}/{script_name} -o {tmp_dir}{script_name} -sSf "
)
cmd.append(download_cmd)

Expand Down

0 comments on commit 3c3b79c

Please sign in to comment.