优化安装逻辑 (#325)

* Optimize install process

If `getenforce` is not exist, then do not execute
it. This fixes the `command not found` error on
Arch Linux systems without SELinux installed.

* bump installer version
This commit is contained in:
1ridic
2024-02-23 22:55:42 +08:00
committed by GitHub
parent ee3cda8aed
commit 0835f13f28
3 changed files with 7 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ NZ_AGENT_SERVICE="/etc/systemd/system/nezha-agent.service"
NZ_AGENT_SERVICERC="/etc/init.d/nezha-agent"
NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service"
NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard"
NZ_VERSION="v0.15.7"
NZ_VERSION="v0.15.8"
red='\033[0;31m'
green='\033[0;32m'
@@ -269,7 +269,8 @@ install_dashboard_standalone() {
selinux() {
#判断当前的状态
if [ "$os_alpine" != 1 ]; then
command -v getenforce >/dev/null 2>&1
if [ $? -eq 0 ]; then
getenforce | grep '[Ee]nfor'
if [ $? -eq 0 ]; then
echo -e "SELinux是开启状态正在关闭"