1
0
This commit is contained in:
2023-09-15 17:11:12 +08:00
parent 667fd6f890
commit 9a45f54cf9
2 changed files with 9 additions and 2 deletions

View File

@@ -56,6 +56,7 @@ cp -f systemd/adb.service ${RPM_BUILD_ROOT}/lib/systemd/system/adb.service
%post
RedisConfDir=/usr/local/db/bin/conf
OMCEtcDir=/usr/local/omc/etc
FERootDir=/usr/local/omc/htdocs/front
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml"
for CFile in ${CFileList}; do
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
@@ -63,6 +64,7 @@ for CFile in ${CFileList}; do
fi
done
if [ ! -e "${RedisConfDir}/redis.conf" ]; then cp ${RedisConfDir}/default/redis.conf ${RedisConfDir}; fi
if [ ! -e "${FERootDir}/config.js" ]; then cp ${FERootDir}/default/config.js ${FERootDir}; fi
if ! id -u omc >/dev/null 2>&1 ; then useradd -d /opt/omc -m -s /bin/bash -p1000ftp@kp omc; else echo "user omc exist"; fi
mkdir -p /opt/omc/ftp
mkdir -p /opt/omc/ftp/log
@@ -84,6 +86,7 @@ systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
systemctl stop adb.service
#rm -rf /usr/local/omc
rm -rf /etc/nginx/conf.d/omc.conf
systemctl disable restagent.service
@@ -94,12 +97,12 @@ systemctl disable adb.service
systemctl daemon-reload
else
systemctl daemon-reload
systemctl restart adb.service
systemctl restart nginx.service
systemctl restart restagent.service
systemctl restart crontask.service
systemctl restart sshsvc.service
systemctl restart captrace.service
systemctl restart adb.service
fi
# 规定那些文件必须放入安装程序中,如果没有就报错