remove bash -lc
This commit is contained in:
@@ -841,13 +841,25 @@ def create_systemd_units(ipv6_enabled: bool):
|
||||
def gather_versions(npm_app_version: str):
|
||||
_ips = run_out(["hostname", "-I"], check=False) or ""
|
||||
ip = (_ips.split() or [""])[0]
|
||||
_angie = run_out(["angie", "-v"], check=False) or ""
|
||||
m = re.search(r"\d+(?:\.\d+)+", _angie)
|
||||
angie_v = m.group(0) if m else _angie.strip()
|
||||
_angie = (run_out(["angie", "-v"], check=False) or "").strip()
|
||||
angie_v = ""
|
||||
for pat in (
|
||||
r"(?i)\bangie\s*/\s*(\d+(?:\.\d+)+)\b",
|
||||
r"(?i)\bangie\s+version:\s*angie/\s*(\d+(?:\.\d+)+)\b",
|
||||
):
|
||||
m = re.search(pat, _angie)
|
||||
if m:
|
||||
angie_v = m.group(1)
|
||||
break
|
||||
if not angie_v:
|
||||
m = re.search(r"\b\d+(?:\.\d+)+\b", _angie)
|
||||
angie_v = m.group(0) if m else _angie
|
||||
|
||||
node_v = (run_out(["node", "-v"], check=False) or "").strip().lstrip("v")
|
||||
yarn_v = (run_out(["yarn", "-v"], check=False) or "").strip()
|
||||
if not yarn_v:
|
||||
yarn_v = (run_out(["yarnpkg", "-v"], check=False) or "").strip()
|
||||
|
||||
return ip, angie_v, node_v, yarn_v, npm_app_version
|
||||
|
||||
def update_motd(enabled: bool, info, ipv6_enabled: bool):
|
||||
|
||||
Reference in New Issue
Block a user