summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshizhendong <[email protected]>2024-05-17 18:37:42 +0800
committershizhendong <[email protected]>2024-05-17 18:37:42 +0800
commit6379f158d63d7acfc7e5b5119d8d6f62e56b7664 (patch)
treef826c962042b75058dbe84259851e091e434f655
parentb16a68d6005c5c7a5c8a32bdcdae83ec4d96ece7 (diff)
build: fpm 打包时添加依赖项nz_ipmi_exporter-24.01.05
-rw-r--r--tools/afterinstall.sh25
1 files changed, 14 insertions, 11 deletions
diff --git a/tools/afterinstall.sh b/tools/afterinstall.sh
index 5bda702..f08edf2 100644
--- a/tools/afterinstall.sh
+++ b/tools/afterinstall.sh
@@ -87,17 +87,20 @@ if [ 1 -eq $1 ];then
fn_init_syslog_logrotate_config
# 检查命令是否存在,以此判断是否存在 freeipmi 依赖
- if ! command -v bmc-info &> /dev/null ||
- ! command -v ipmimonitoring &> /dev/null ||
- ! command -v ipmi-dcmi &> /dev/null ||
- ! command -v ipmi-sel &> /dev/null; then
-
- echo 'freeipmi not found, start install'
- yum install -y /opt/nezha/ipmi_exporter/deps/freeipmi-1.5.7-3.el7.x86_64.rpm
- echo 'freeipmi install completed'
- else
- echo 'freeipmi already exists'
- fi
+ (
+ if ! command -v bmc-info &> /dev/null ||
+ ! command -v ipmimonitoring &> /dev/null ||
+ ! command -v ipmi-dcmi &> /dev/null ||
+ ! command -v ipmi-sel &> /dev/null; then
+
+ echo 'freeipmi not found, start install'
+ sleep 10s
+ rpm -ivh /opt/nezha/ipmi_exporter/deps/freeipmi-1.5.7-3.el7.x86_64.rpm &> /dev/null
+ echo 'freeipmi install completed'
+ else
+ echo 'freeipmi already exists'
+ fi
+ ) &
systemctl daemon-reload
systemctl enable nz-ipmi-exporter && systemctl restart nz-ipmi-exporter