mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
Fix select_version (#306)
This commit is contained in:
parent
2106ca41e1
commit
d790ca04d6
@ -4,7 +4,7 @@
|
|||||||
<br>
|
<br>
|
||||||
<small><i>LOGO designed by <a href="https://xio.ng" target="_blank">熊大</a> .</i></small>
|
<small><i>LOGO designed by <a href="https://xio.ng" target="_blank">熊大</a> .</i></small>
|
||||||
<br><br>
|
<br><br>
|
||||||
<img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&style=for-the-badge&logo=github&label=Dashboard"> <img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github"> <img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge"> <img src="https://img.shields.io/badge/Installer-v0.15.2-brightgreen?style=for-the-badge&logo=linux">
|
<img alt="GitHub release (with filter)" src="https://img.shields.io/github/v/release/naiba/nezha?color=brightgreen&style=for-the-badge&logo=github&label=Dashboard"> <img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github"> <img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge"> <img src="https://img.shields.io/badge/Installer-v0.15.3-brightgreen?style=for-the-badge&logo=linux">
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<p>:trollface: <b>Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.</b></p>
|
<p>:trollface: <b>Nezha Monitoring: Self-hostable, lightweight, servers and websites monitoring and O&M tool.</b></p>
|
||||||
|
@ -14,7 +14,7 @@ NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service"
|
|||||||
NZ_AGENT_SERVICERC="/etc/init.d/nezha-agent"
|
NZ_AGENT_SERVICERC="/etc/init.d/nezha-agent"
|
||||||
NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service"
|
NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service"
|
||||||
NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard"
|
NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard"
|
||||||
NZ_VERSION="v0.15.2"
|
NZ_VERSION="v0.15.3"
|
||||||
|
|
||||||
red='\033[0;31m'
|
red='\033[0;31m'
|
||||||
green='\033[0;32m'
|
green='\033[0;32m'
|
||||||
@ -794,11 +794,20 @@ clean_all() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
select_version() {
|
select_version() {
|
||||||
|
DOCKER_COMPOSE_COMMAND=""
|
||||||
if command -v docker compose >/dev/null 2>&1; then
|
if command -v docker compose >/dev/null 2>&1; then
|
||||||
if docker compose ls | grep -qw "$NZ_DASHBOARD_PATH/docker-compose.yaml" >/dev/null 2>&1; then
|
DOCKER_COMPOSE_COMMAND="docker compose"
|
||||||
|
elif command -v docker-compose >/dev/null 2>&1; then
|
||||||
|
DOCKER_COMPOSE_COMMAND="docker-compose"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $DOCKER_COMPOSE_COMMAND ]]; then
|
||||||
|
if $DOCKER_COMPOSE_COMMAND ls | grep -qw "$NZ_DASHBOARD_PATH/docker-compose.yaml" >/dev/null 2>&1; then
|
||||||
IS_DOCKER_NEZHA=1
|
IS_DOCKER_NEZHA=1
|
||||||
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f $NZ_DASHBOARD_PATH/app ]]; then
|
if [[ -f $NZ_DASHBOARD_PATH/app ]]; then
|
||||||
IS_DOCKER_NEZHA=0
|
IS_DOCKER_NEZHA=0
|
||||||
else
|
else
|
||||||
|
@ -14,7 +14,7 @@ NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service"
|
|||||||
NZ_AGENT_SERVICERC="/etc/init.d/nezha-agent"
|
NZ_AGENT_SERVICERC="/etc/init.d/nezha-agent"
|
||||||
NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service"
|
NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service"
|
||||||
NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard"
|
NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard"
|
||||||
NZ_VERSION="v0.15.2"
|
NZ_VERSION="v0.15.3"
|
||||||
|
|
||||||
red='\033[0;31m'
|
red='\033[0;31m'
|
||||||
green='\033[0;32m'
|
green='\033[0;32m'
|
||||||
@ -792,11 +792,20 @@ clean_all() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
select_version() {
|
select_version() {
|
||||||
|
DOCKER_COMPOSE_COMMAND=""
|
||||||
if command -v docker compose >/dev/null 2>&1; then
|
if command -v docker compose >/dev/null 2>&1; then
|
||||||
if docker compose ls | grep -qw "$NZ_DASHBOARD_PATH/docker-compose.yaml" >/dev/null 2>&1; then
|
DOCKER_COMPOSE_COMMAND="docker compose"
|
||||||
|
elif command -v docker-compose >/dev/null 2>&1; then
|
||||||
|
DOCKER_COMPOSE_COMMAND="docker-compose"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $DOCKER_COMPOSE_COMMAND ]]; then
|
||||||
|
if $DOCKER_COMPOSE_COMMAND ls | grep -qw "$NZ_DASHBOARD_PATH/docker-compose.yaml" >/dev/null 2>&1; then
|
||||||
IS_DOCKER_NEZHA=1
|
IS_DOCKER_NEZHA=1
|
||||||
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f $NZ_DASHBOARD_PATH/app ]]; then
|
if [[ -f $NZ_DASHBOARD_PATH/app ]]; then
|
||||||
IS_DOCKER_NEZHA=0
|
IS_DOCKER_NEZHA=0
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user