From 9a45f54cf9ccb6f387e104a66951290968c43cad Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Fri, 15 Sep 2023 17:11:12 +0800 Subject: [PATCH] d --- debbuild/DEBIAN/postinst | 6 +++++- rpmbuild/SPECS/omc.spec | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debbuild/DEBIAN/postinst b/debbuild/DEBIAN/postinst index d5d4407..cd2a7f3 100644 --- a/debbuild/DEBIAN/postinst +++ b/debbuild/DEBIAN/postinst @@ -2,6 +2,7 @@ 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" echo "" @@ -29,7 +30,10 @@ for CFile in ${CFileList}; do done if [ ! -e "${RedisConfDir}/redis.conf" ]; then cp ${RedisConfDir}/default/redis.conf ${RedisConfDir}; -fi +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 -pomc123 omc; mkdir -p /opt/omc/ftp diff --git a/rpmbuild/SPECS/omc.spec b/rpmbuild/SPECS/omc.spec index 8d4d8f3..0d84af0 100644 --- a/rpmbuild/SPECS/omc.spec +++ b/rpmbuild/SPECS/omc.spec @@ -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 # 规定那些文件必须放入安装程序中,如果没有就报错