diff options
| author | shizhendong <[email protected]> | 2024-05-22 10:57:38 +0800 |
|---|---|---|
| committer | shizhendong <[email protected]> | 2024-05-22 10:57:38 +0800 |
| commit | 2a32f164b1ff2b69a5366a4be001ab0b67d26b28 (patch) | |
| tree | 1f90fce152db729f0941470c2a6fba9541011064 | |
| parent | abda618596680520e938bd86d7ecdc87e1cf0ffa (diff) | |
fix: 修改执行脚本nz_ipmi_exporter-24.01.11
| -rw-r--r-- | deb_tools/afterinstall.sh | 4 | ||||
| -rw-r--r-- | deb_tools/afterremove.sh | 2 | ||||
| -rw-r--r-- | deb_tools/beforeinstall.sh | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/deb_tools/afterinstall.sh b/deb_tools/afterinstall.sh index a999dd0..71cbeca 100644 --- a/deb_tools/afterinstall.sh +++ b/deb_tools/afterinstall.sh @@ -81,7 +81,7 @@ restoreComponentConfig(){ } # install -if [ 1 -eq $1 ];then +if (( 1 == $1 )); then fn_init_config fn_init_service fn_init_syslog_logrotate_config @@ -109,7 +109,7 @@ if [ 1 -eq $1 ];then fi # update -if [ 2 -eq $1 ];then +if (( 2 == $1 )); then fn_init_config fn_init_service fn_init_syslog_logrotate_config diff --git a/deb_tools/afterremove.sh b/deb_tools/afterremove.sh index af18cef..b91dd95 100644 --- a/deb_tools/afterremove.sh +++ b/deb_tools/afterremove.sh @@ -3,7 +3,7 @@ # 安装目录 NZ_IPMI_EXPORTER_PATH=/opt/nezha/ipmi_exporter -if [ 0 -eq $1 ];then +if (( 0 == $1 )); then echo 'start remove nz-ipmi-exporter from disk...' diff --git a/deb_tools/beforeinstall.sh b/deb_tools/beforeinstall.sh index c591940..d5a5f43 100644 --- a/deb_tools/beforeinstall.sh +++ b/deb_tools/beforeinstall.sh @@ -15,7 +15,7 @@ if [ -d $NZ_IPMI_EXPORTER_PATH ];then fi # 停止服务并卸载 -if [ 0 -lt $(rpm -aq nz-ipmi-exporter|wc -w) ];then +if [ 0 -lt $(dpkg -l | grep nz-ipmi-exporter | wc -l) ];then echo "stop nz-ipmi-exporter service" systemctl stop nz-ipmi-exporter.service echo 'clean before install...' |
