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