opt: rpm support environment parameter to DB install or upgrade
This commit is contained in:
@@ -118,14 +118,36 @@ systemctl enable restagent.service
|
||||
systemctl enable crontask.service
|
||||
systemctl enable sshsvc.service
|
||||
systemctl enable captrace.service
|
||||
|
||||
# read environment parameter and to do
|
||||
if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
|
||||
echo "M parameter: $M_PARAM"
|
||||
if [ -n "$C_PARAM" ]; then
|
||||
echo "C parameter: $C_PARAM"
|
||||
${OMCRootDir}/bin/setomc.sh -m $M_PARAM -c $C_PARAM
|
||||
else
|
||||
${OMCRootDir}/bin/setomc.sh -m $M_PARAM
|
||||
fi
|
||||
# exit while failed to run setomc.sh
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "setomc.sh execution failed. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -n "Stopping OMC service ... "
|
||||
systemctl stop restagent.service
|
||||
systemctl stop crontask.service
|
||||
systemctl stop sshsvc.service
|
||||
systemctl stop captrace.service
|
||||
echo "done"
|
||||
|
||||
echo -n "Starting OMC service ... "
|
||||
systemctl start captrace.service
|
||||
systemctl start sshsvc.service
|
||||
systemctl start crontask.service
|
||||
systemctl start restagent.service
|
||||
echo "done"
|
||||
|
||||
# 卸载时执行
|
||||
%postun
|
||||
|
||||
Reference in New Issue
Block a user