From 81e254ab76a8c366c1d32142672d5e3db71dafe1 Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Wed, 10 Jan 2024 17:05:21 +0800 Subject: [PATCH] fix: postinst update --- debbuild/22.04/DEBIAN/postinst | 7 +++++++ debbuild/DEBIAN/postinst | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/debbuild/22.04/DEBIAN/postinst b/debbuild/22.04/DEBIAN/postinst index c435df5..d7798c5 100644 --- a/debbuild/22.04/DEBIAN/postinst +++ b/debbuild/22.04/DEBIAN/postinst @@ -5,12 +5,14 @@ OMCEtcDir=/usr/local/omc/etc FERootDir=/usr/local/omc/htdocs/front X86Lib64Dir=/lib/x86_64-linux-gnu OmcBinDir=/usr/local/omc/bin +OMCStaticDir=/usr/local/omc/static UsrLocalBinDir=/usr/local/bin OmcDaemon=omcd NginxEtcDir=/etc/nginx NginxConfDir=${NginxEtcDir}/conf.d NginxSiteAvailable=${NginxEtcDir}/sites-available CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml" +LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png" echo "" echo "* To start/stop/restart/status omc service, please run:" @@ -59,6 +61,11 @@ fi if [ ! -e "${FERootDir}/config.js" ]; then cp ${FERootDir}/default/config.js ${FERootDir}; fi +for LogoFile in ${LogoFileList}; do + if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then + cp ${OMCStaticDir}/agt.d/logo/${LogoFile} ${OMCStaticDir}/logo; + fi +done 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/debbuild/DEBIAN/postinst b/debbuild/DEBIAN/postinst index cb149b7..21e95d7 100644 --- a/debbuild/DEBIAN/postinst +++ b/debbuild/DEBIAN/postinst @@ -5,12 +5,14 @@ OMCEtcDir=/usr/local/omc/etc FERootDir=/usr/local/omc/htdocs/front X86Lib64Dir=/lib/x86_64-linux-gnu OmcBinDir=/usr/local/omc/bin +OMCStaticDir=/usr/local/omc/static UsrLocalBinDir=/usr/local/bin OmcDaemon=omcd NginxEtcDir=/etc/nginx NginxConfDir=${NginxEtcDir}/conf.d NginxSiteAvailable=${NginxEtcDir}/sites-available CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml" +LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png" echo "" echo "* To start/stop/restart/status omc service, please run:" @@ -58,7 +60,12 @@ else fi if [ ! -e "${FERootDir}/config.js" ]; then cp ${FERootDir}/default/config.js ${FERootDir}; -fi +fi +for LogoFile in ${LogoFileList}; do + if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then + cp ${OMCStaticDir}/agt.d/logo/${LogoFile} ${OMCStaticDir}/logo; + fi +done if ! id -u omc >/dev/null 2>&1 ; then useradd -d /opt/omc -m -s /bin/bash -pomc123 omc; mkdir -p /opt/omc/ftp