installer: fix docker-compose detection (#427)

This commit is contained in:
UUBulb 2024-10-05 23:43:16 +08:00 committed by GitHub
parent 318da135b9
commit c4d8b63d32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 9 deletions

View File

@ -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">&nbsp;<img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.19.0-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">&nbsp;<img src="https://img.shields.io/github/v/release/nezhahq/agent?color=brightgreen&label=Agent&style=for-the-badge&logo=github">&nbsp;<img src="https://img.shields.io/github/actions/workflow/status/nezhahq/agent/agent.yml?label=Agent%20CI&logo=github&style=for-the-badge">&nbsp;<img src="https://img.shields.io/badge/Installer-v0.19.1-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>

View File

@ -12,7 +12,7 @@ NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard"
NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_AGENT_PATH="${NZ_BASE_PATH}/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.19.0" NZ_VERSION="v0.19.1"
red='\033[0;31m' red='\033[0;31m'
green='\033[0;32m' green='\033[0;32m'
@ -65,6 +65,8 @@ geo_check() {
} }
pre_check() { pre_check() {
umask 077
## os_arch ## os_arch
if uname -m | grep -q 'x86_64'; then if uname -m | grep -q 'x86_64'; then
os_arch="amd64" os_arch="amd64"
@ -168,6 +170,9 @@ installation_check() {
echo "未找到带有 nezha-dashboard 仓库的 Docker 镜像。" echo "未找到带有 nezha-dashboard 仓库的 Docker 镜像。"
fi fi
fi fi
else
err "请手动安装 docker-compose。https://docs.docker.com/compose/install/linux/"
exit 1
fi fi
if [ -f "$NZ_DASHBOARD_PATH/app" ]; then if [ -f "$NZ_DASHBOARD_PATH/app" ]; then
@ -288,8 +293,6 @@ install_dashboard() {
esac esac
fi fi
sudo chmod -R 700 $NZ_DASHBOARD_PATH
if [ "$IS_DOCKER_NEZHA" = 1 ]; then if [ "$IS_DOCKER_NEZHA" = 1 ]; then
install_dashboard_docker install_dashboard_docker
elif [ "$IS_DOCKER_NEZHA" = 0 ]; then elif [ "$IS_DOCKER_NEZHA" = 0 ]; then
@ -375,7 +378,6 @@ install_agent() {
# 哪吒监控文件夹 # 哪吒监控文件夹
sudo mkdir -p $NZ_AGENT_PATH sudo mkdir -p $NZ_AGENT_PATH
sudo chmod -R 700 $NZ_AGENT_PATH
echo "正在下载监控端" echo "正在下载监控端"
if [ -z "$CN" ]; then if [ -z "$CN" ]; then

View File

@ -12,7 +12,7 @@ NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard"
NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" NZ_AGENT_PATH="${NZ_BASE_PATH}/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.19.0" NZ_VERSION="v0.19.1"
red='\033[0;31m' red='\033[0;31m'
green='\033[0;32m' green='\033[0;32m'
@ -65,6 +65,8 @@ geo_check() {
} }
pre_check() { pre_check() {
umask 077
## os_arch ## os_arch
if uname -m | grep -q 'x86_64'; then if uname -m | grep -q 'x86_64'; then
os_arch="amd64" os_arch="amd64"
@ -167,6 +169,9 @@ installation_check() {
echo "No Docker images with the nezha-dashboard repository were found." echo "No Docker images with the nezha-dashboard repository were found."
fi fi
fi fi
else
err "Please install docker-compose manually. https://docs.docker.com/compose/install/linux/"
exit 1
fi fi
if [ -f "$NZ_DASHBOARD_PATH/app" ]; then if [ -f "$NZ_DASHBOARD_PATH/app" ]; then
@ -287,8 +292,6 @@ install_dashboard() {
esac esac
fi fi
sudo chmod -R 700 $NZ_DASHBOARD_PATH
if [ "$IS_DOCKER_NEZHA" = 1 ]; then if [ "$IS_DOCKER_NEZHA" = 1 ]; then
install_dashboard_docker install_dashboard_docker
elif [ "$IS_DOCKER_NEZHA" = 0 ]; then elif [ "$IS_DOCKER_NEZHA" = 0 ]; then
@ -374,7 +377,6 @@ install_agent() {
# Nezha Monitoring Folder # Nezha Monitoring Folder
sudo mkdir -p $NZ_AGENT_PATH sudo mkdir -p $NZ_AGENT_PATH
sudo chmod -R 700 $NZ_AGENT_PATH
echo "Downloading Agent" echo "Downloading Agent"
wget -t 2 -T 60 -O nezha-agent_linux_${os_arch}.zip https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_linux_${os_arch}.zip >/dev/null 2>&1 wget -t 2 -T 60 -O nezha-agent_linux_${os_arch}.zip https://${GITHUB_URL}/nezhahq/agent/releases/download/${version}/nezha-agent_linux_${os_arch}.zip >/dev/null 2>&1