1
0

feat: nbi interface md

This commit is contained in:
simon
2025-05-23 18:11:05 +08:00
parent 1cda2618f3
commit d0d4efed93
2 changed files with 65 additions and 9 deletions

View File

@@ -29,6 +29,13 @@ chmod +rx ${RPM_BUILD_ROOT}/usr/local/bin/*
chmod +x ${RPM_BUILD_ROOT}/usr/local/omc/htdocs/front
chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/*
# 安装前执行
%pre
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop sshsvc.service
echo "done"
# 安装完成后执行
%post
OMCRootDir=/usr/local/omc
@@ -42,10 +49,10 @@ NginxEtcDir=/etc/nginx
CFileList="restconf.yaml sshsvc.yaml omc.conf"
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop sshsvc.service
echo "done"
# echo -n "Stopping OMC service ... "
# systemctl stop restagent.service
# systemctl stop sshsvc.service
# echo "done"
for CFile in ${CFileList}; do
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
@@ -76,7 +83,7 @@ if [ ! -e ${UsrLocalBinDir}/${OMCDaemon} ]; then
fi
# setting firewall
port_list="80 443 44080 44443 33030 33443 3066 6379 22222"
port_list="80 443 44080 44443 33030 33443 33066 6379 22222"
for Port in ${port_list}; do
echo -n "firewall-cmd add port ${Port} ... "
firewall-cmd --zone=public --add-port=${Port}/tcp --permanent
@@ -103,10 +110,10 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
fi
echo -n "Starting OMC service ... "
systemctl start sshsvc.service
systemctl start restagent.service
echo "done"
# echo -n "Starting OMC service ... "
# systemctl start sshsvc.service
# systemctl start restagent.service
# echo "done"
# 卸载时执行
%postun
@@ -130,11 +137,13 @@ if [ "$1" = "0" ] ; then
firewall-cmd --reload
rm -f ${UsrLocalBinDir}/${OMCDaemon}
else
echo -n "Starting OMC service ... "
sudo systemctl daemon-reload
sudo systemctl stop restagent.service
sudo systemctl stop sshsvc.service
sudo systemctl start sshsvc.service
sudo systemctl start restagent.service
echo "done"
fi
# 规定那些文件必须放入安装程序中,如果没有就报错