46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
# !/bin/bash
|
|
|
|
RedisRootDir=/usr/local
|
|
OMCRootDir=/usr/local/omc
|
|
OMCEtcDir=${OMCRootDir}/etc
|
|
OMCStaticDir=${OMCRootDir}/static
|
|
CFileList="omc.yaml omc.conf"
|
|
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
|
|
|
|
echo ""
|
|
echo "* To start/stop/restart/status omc service, please run:"
|
|
echo " sudo systemctl start/stop/restart/status omc.service"
|
|
echo " or run: "
|
|
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
|
|
echo ""
|
|
|
|
chmod +rx ${OMCRootDir}/bin/*
|
|
|
|
chmod -R 755 ${OMCRootDir}/htdocs/front
|
|
|
|
for CFile in ${CFileList}; do
|
|
if [ ! -e "${OMCEtcDir}/${CFile}" ]; then
|
|
cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
|
|
fi
|
|
done
|
|
|
|
for LogoFile in ${LogoFileList}; do
|
|
if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
|
|
cp ${OMCStaticDir}/agt.d/logo/${LogoFile} ${OMCStaticDir}/logo;
|
|
fi
|
|
done
|
|
|
|
if [ ! -e "${NginxConfDir}/default.conf" ]; then
|
|
mkdir -p ${NginxConfDir}
|
|
cp -f ${OMCEtcDir}/nginx/default.conf ${NginxConfDir};
|
|
fi
|
|
|
|
# disable auto upgrade
|
|
systemctl disable --now unattended-upgrades
|
|
|
|
systemctl enable omc.service
|
|
systemctl daemon-reload
|
|
systemctl stop omc.service
|
|
systemctl start omc.service
|
|
|