1
0

69 Commits

Author SHA1 Message Date
TsMask
c77981e587 feat: 脚本替换版本号 2025-08-15 18:27:33 +08:00
TsMask
745ec999b4 feat: 更新版本号为2.2508.1,并调整相关脚本和配置文件 2025-08-15 16:38:57 +08:00
TsMask
1054da9b4e fix: 相对路径进行打包处理 2025-08-15 16:12:41 +08:00
TsMask
6226809e8d chore: sed error tip info fix 2025-08-15 15:57:34 +08:00
TsMask
86f994cbe6 rev: sed: -e expression #1, char 46: Invalid collation character 2025-08-15 15:03:48 +08:00
TsMask
6ff8e49cf6 feat: 更新README和pkg.sh,提升构建指南和输出信息 2025-08-15 14:16:19 +08:00
TsMask
858eec188a feat: 更新版本占位符并重构打包脚本 2025-08-15 12:05:17 +08:00
TsMask
73911f3192 fix: 更新前端背景图资源路径和复制逻辑 2025-08-15 11:31:57 +08:00
TsMask
8f50df5bd1 fix sed: -e expression #1, char 46: Invalid collation character 2025-08-15 11:27:43 +08:00
TsMask
f9a2a84144 feat: 添加ub24识别 2025-08-15 11:20:38 +08:00
TsMask
ec756261be feat: 添加ub24识别 2025-08-15 11:12:46 +08:00
TsMask
f8e17fbcd6 fix: 更新版权年份至2025 2025-08-14 17:43:13 +08:00
TsMask
255f531fb7 chore: 更新版本号 2.2508.1 2025-08-11 19:27:53 +08:00
TsMask
75405e0482 fix: 去掉perl操作restconf.yaml 2025-08-11 19:22:32 +08:00
TsMask
e176154f73 chore: 更新版本号 2.2507.3 2025-07-25 14:14:05 +08:00
TsMask
c893d8d051 chore: 更新版本号 2.2507.2 2025-07-18 16:40:57 +08:00
TsMask
234a403bca chore: 更新版本号 2.2507.1 2025-07-05 10:24:55 +08:00
TsMask
ac9d369235 chore: 更新版本号 2.2506.3 2025-06-27 19:28:50 +08:00
TsMask
cde04d7608 chore: 更新版本号 2.2506.2 2025-06-20 19:22:05 +08:00
TsMask
b6dc85e51e chore: 更新版本号 2.2506.1 2025-06-13 20:18:28 +08:00
TsMask
8000d6c263 chore: 更新版本号 2.2505.4 2025-06-07 11:07:01 +08:00
TsMask
8447da9d46 chore: 更新版本号 2.2505.3 2025-05-23 15:07:31 +08:00
TsMask
8def038993 chore: 更新版本号 2.2505.2 2025-05-16 09:57:36 +08:00
TsMask
271aaa1f69 chore: 更新版本号 2.2505.1 2025-05-09 19:42:54 +08:00
TsMask
3a1cac9f0e chore: 更新版本号 2.2504.4 2025-04-28 19:45:38 +08:00
TsMask
5b47a8d366 fix: 移除后创建目录 db 2025-04-18 15:35:02 +08:00
zhangsz
b18224c95d fix: checkout fe by replace Zh 2025-04-18 15:07:11 +08:00
zhangsz
14623348b8 fix: deb copy ba.d 2025-04-18 15:01:32 +08:00
zhangsz
e5ca189b05 release for 2.2504.2 2025-04-16 11:46:44 +08:00
zhangsz
f84d4e48a8 release for 2.2504.1 2025-04-09 14:31:41 +08:00
zhangsz
521936fbcc move build sh to bin 2025-03-26 14:12:27 +08:00
zhangsz
1bb763df6e make pkg changed 2025-03-26 14:09:22 +08:00
zhangsz
e8d51f0821 ... 2025-03-26 11:16:45 +08:00
zhangsz
72d299a87a ignore file 2025-03-26 11:15:18 +08:00
TsMask
fc8d8bd9d9 chore: 更新版本号 2.2503.3 2025-03-21 15:19:32 +08:00
TsMask
764ef45098 chore: 更新版本号 2.2503.2 2025-03-14 11:04:25 +08:00
TsMask
dd9ded3ad1 chore: 更新版本号 2.2503.1 2025-03-08 11:10:57 +08:00
TsMask
32a0fc7d46 chore: 更新版本号 2.2502.4 2025-03-04 16:34:50 +08:00
TsMask
4bc25c840a fix: badeb 中文字符串替换 2025-03-04 16:32:02 +08:00
TsMask
cc7a42edb2 fix: badeb 中文字符串替换 2025-03-04 16:29:49 +08:00
TsMask
b5a4d8f084 fix: badeb 中文字符串替换 2025-03-04 16:17:35 +08:00
TsMask
22cad473ab chore: 更新版本号 2.2502.3 2025-02-25 16:36:37 +08:00
TsMask
8426a91eec chore: 更新版本号 2.2502.2 2025-02-14 20:17:30 +08:00
TsMask
45bed62998 chore: 更新版本号 2.2501.4 2025-01-24 20:50:49 +08:00
TsMask
e5fd1fe7a2 fix: 安装错误42:do 2025-01-22 21:12:03 +08:00
TsMask
5820c66f8b chore: 更新版本号 2.2501.3 2025-01-17 18:44:24 +08:00
TsMask
f1250f6409 del: 移除captrace/data2html/crontask程序 2025-01-11 12:19:09 +08:00
TsMask
9e4427b3e8 chore: 更新版本号 2.2501.2 2025-01-10 19:42:51 +08:00
TsMask
4566d4ff4c chore: 更新版本号 2.2501.1 2025-01-03 21:51:51 +08:00
TsMask
eba31a09a2 chore: 更新版本号 2.2412.3 2024-12-24 17:37:50 +08:00
TsMask
60e4034ca8 chore: 更新版本号 2.2412.2 2024-12-13 21:29:19 +08:00
TsMask
0676d237ec release 2.2412.1 2024-12-09 11:15:00 +08:00
simonzhangsz
f2de67e311 release 2.2412.1 2024-12-07 13:40:07 +08:00
simonzhangsz
106d499eae feat: update backgroud for agt and omc package 2024-12-07 11:54:44 +08:00
16ce7958f0 fix: release 2.2411.2 2024-11-18 19:56:15 +08:00
f1d7c0b1b7 release 2.2411.2 2024-11-15 09:53:24 +08:00
a2278d066c fix: .... 2024-11-14 20:52:04 +08:00
d96a2400ce fix: ... 2024-11-14 19:58:00 +08:00
39204e55c0 fix: update yaml config file issue 2024-11-14 19:45:18 +08:00
6a60d55180 update gitignore 2024-11-14 18:47:48 +08:00
8fb18ef6bb fix: remvoe cp omc.d logo file while install package 2024-11-14 18:11:39 +08:00
e389f98b46 release 2.2411.1 2024-11-08 15:42:24 +08:00
fa9870f690 support backgroup replace 2024-11-07 17:59:15 +08:00
09250dfaf8 support customized images and locales 2024-11-07 16:36:04 +08:00
0946603828 update make package shell for npm install 2024-11-05 18:17:37 +08:00
23591dfda0 ... 2024-11-01 16:43:01 +08:00
1a97be11df ... 2024-11-01 16:10:49 +08:00
2454fbf1d6 ... 2024-11-01 15:57:03 +08:00
f3ee5c189b ... 2024-11-01 15:53:57 +08:00
33 changed files with 283 additions and 237 deletions

17
.gitignore vendored
View File

@@ -18,8 +18,15 @@ docs/temp/
# build and release package
build/
!build/usr/local/omc/etc/db
debbuild/
!debbuild/22.04/DEBIAN/
!debbuild/DEBIAN/
release/
debbuild/etc
debbuild/usr
debbuild/lib
debbuild/22.04/etc
debbuild/22.04/usr
debbuild/22.04/lib
# !debbuild/DEBIAN
# !debbuild/22.04/DEBIAN
# --> release
release/*
# --> debbuild

View File

@@ -6,21 +6,31 @@ OS: Ubuntu 18.04 / 22.04 (Recommendation)
Arch: amd64
Golang: go1.22.1 linux/amd64
Database: 10.6.16-MariaDB, Redis server v=5.0.5 (or above)
node.js: v18.16.0 (or above)
- Golang: go1.24.2 linux/amd64
- node.js: v20.18.0 (or above)
## Build Guide
```bash
git clone https://xxx@bitbucket.org/bluearcuscom/ems.git omc.git
cd omc.git
git pull
cd fe.ems.vue3
npm install
npm run build
cd ../build.ems
./build.sh deb
# pwd
cd /root/omc.git
# ls
# be.ems build.ems fe.ems.vue3
cp build.ems/pkg.sh .
bash pkg.sh --web --api -v 2.2508.1
```
Encountered character error
error: `sed: -e expression #1, char 46: Invalid collation character`
```bash
sudo apt-get update
sudo apt-get install locales
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8
source /etc/default/locale
locale
```

View File

@@ -31,7 +31,8 @@ fi
# Use a new parameter list
set -- "${new_args[@]}"
GitLocalRoot=${HOME}/omc.git
RootDir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
GitLocalRoot=$(dirname $(dirname "$RootDir"))
while getopts "r:d" option; do
case $option in
r)
@@ -56,9 +57,9 @@ fi
ProjectL=omc
ProjectU=OMC
PROJECT=${ProjectL}
VERSION=2.2410.2
VERSION=2.2508.1
RelDate=`date +%Y%m%d`
RelVer=${VERSION}-${RelDate}
RelVer=${VERSION}-${RelDate}-mt
Ky10Arch=ky10.aarch64
RpmPkgName=${ProjectL}-${RelVer}.ky10.aarch64.rpm
RpmPkgRename=${ProjectL}-r${RelVer}-ky10.rpm
@@ -93,24 +94,13 @@ EmsFEDir=${GitLocalRoot}/fe.ems
EmsFEVue3Dir=${GitLocalRoot}/fe.ems.vue3/dist
LibDir=${EmsBEDir}/lib
RESTAGENT=restagent
CRONTASK=crontask
SshSvcBin=sshsvc
CapTraceBin=captrace
Data2htmlBin=data2html
NBI_ALARM=nbi_alarm
NBI_AGENT=nbi_agent
AAAA_AGENT=4a_agent
RestagentDir=${EmsBEDir}/${RESTAGENT}
CrontaskDir=${EmsBEDir}/${CRONTASK}
SshSvcDir=${EmsBEDir}/${SshSvcBin}
CapTraceDir=${EmsBEDir}/${CapTraceBin}
Data2htmlDir=${EmsBEDir}/${Data2htmlBin}
DBSQLSrcDir=${EmsBEDir}/database
MiscDir=${EmsBEDir}/misc
FrontBuildDir=${BuildOMCDir}/htdocs
FrontSrcDir=${EmsBEDir}/front
CrontaskSize=27788951
RestagentSize=29525312
BinWriterDir=${HOME}/bin
if [[ ${RpmArch} =~ "x86_64" ]];then
@@ -121,15 +111,8 @@ fi
case "${pkgtype}" in
rpm)
ReleasePkgDir=${ReleaseDir}/rpms/${RelArch}
ProcList="restagent crontask sshsvc captrace data2html"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
echo "Make $procName ..."
make
done
echo "Begin to make ${pkgtype} package ======>"
cd $EmsBEDir
# make rpm
# clear build cache
@@ -138,24 +121,14 @@ case "${pkgtype}" in
rm -rf ${RpmBuildDir}/BUILD/usr/local/omc/etc/db/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
# ${BinWriterDir}/binWriter ${BuildOMCBinDir}/${RESTAGENT} ${RestagentSize}
# ${BinWriterDir}/binWriter ${BuildOMCBinDir}/${CRONTASK} ${CrontaskSize}
# cp -rf ${MiscDir}/ne-hosts ${BuildOMCBinDir}
# cp -rf ./nbi/${NBI_ALARM}/bin/${NBI_ALARM} ${BinDir2}
# cp -rf ./nbi/${NBI_AGENT}/bin/${NBI_AGENT} ${BinDir2}
# cp -rf ./${4A_AGENT}/bin/${4A_AGENT} ${BinDir2}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
# rm -rf ${BinDir2}/ne-hosts
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
rm -rf ${BuildOMCEtcDir}/db && mkdir -p ${BuildOMCEtcDir}/db
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
#Get SQL from database, overwrite from git
if [ "$dumpdb" = "yes" ]; then
cd ${DumpToolDir}
@@ -173,22 +146,17 @@ case "${pkgtype}" in
#cp -rf ${BuildDir}/systemd ${RpmBuildDir}/BUILD/lib/
cd ${RpmBuildDir}
rpmbuild -bb -D "_topdir ${RpmBuildDir}" ${RpmBuildDir}/SPECS/omc.spec
ReleasePkgDir=${ReleaseDir}/rpms/${RelArch}
mv -f $RpmsDir/$RpmArch/$RpmPkgName ${ReleasePkgDir}/$RpmPkgRename
cd ${ReleasePkgDir}
rm -f omc-md5sum.txt
# rpm --addsign *.rpm
md5sum $RpmPkgRename >omc-md5sum.txt
echo "Finish to make ${pkgtype} package <======"
;;
deb)
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
ProcList="restagent crontask sshsvc captrace data2html"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
echo "Make $procName ..."
make
done
echo "Begin to make ${pkgtype} package ======>"
VersionID=`grep VERSION_ID /etc/os-release`
if [[ ${VersionID} =~ 'VERSION_ID="22.04"' ]]; then
@@ -196,14 +164,22 @@ case "${pkgtype}" in
DebBuildOMCDir=${DebBuild2204OMCDir}
DebFEBuildDir=${DebFEBuild2204Dir}
#DebPkgFile=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22.deb
DebPkgFile=${PROJECT}-r${RelVer}-ub22.deb
if [ ! $ProjectTag = "" ]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22-${ProjectTag}.deb
DebPkgFile=${ProjectL}-r${RelVer}-ub22-${ProjectTag}.deb
fi
elif [[ ${VersionID} =~ 'VERSION_ID="24.04"' ]]; then
DebBuildDir=${DebBuild2204Dir}
DebBuildOMCDir=${DebBuild2204OMCDir}
DebFEBuildDir=${DebFEBuild2204Dir}
DebPkgFile=${PROJECT}-r${RelVer}-ub24.deb
if [ ! $ProjectTag = "" ]; then
DebPkgFile=${ProjectL}-r${RelVer}-ub24-${ProjectTag}.deb
fi
elif [[ ${VersionID} =~ 'VERSION_ID="18.04"' ]]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18.deb
DebPkgFile=${ProjectL}-r${RelVer}-ub18.deb
if [ ! $ProjectTag = "" ]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18-${ProjectTag}.deb
DebPkgFile=${ProjectL}-r${RelVer}-ub18-${ProjectTag}.deb
fi
else
echo "Invalid OS release: ${VersionID}"
@@ -220,17 +196,13 @@ case "${pkgtype}" in
rm -rf ${DebBuildOMCDir}/static/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
rm -rf ${BuildOMCEtcDir}/db && mkdir -p ${BuildOMCEtcDir}/db
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
#Get SQL from database, overwrite from git
if [ "${dumpdb}" = "yes" ]; then
cd ${DumpToolDir}
@@ -246,27 +218,22 @@ case "${pkgtype}" in
cp -rf ${BuildDir}/* ${DebBuildDir}/
cp -rf ${CustomizedDir}/agt.d ${DebBuildOMCDir}/static
cp -rf ${CustomizedDir}/omc.d ${DebBuildOMCDir}/static
cp -rf ${CustomizedDir}/ba.d ${DebBuildOMCDir}/static
#cp -rf ${BuildDir}/nginx/* ${DebBuildDir}/etc/nginx/conf.d
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
sed -i "s/YYYYMMDD/${RelDate}/g" ${DebBuildDir}/DEBIAN/control
perl -0777 -i -pe 's/ne:\n user: root/ne:\n user: omcuser/g' ${DebBuildDir}/usr/local/omc/etc/default/restconf.yaml
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
dpkg -b ${DebBuildDir} ${ReleasePkgDir}/${DebPkgFile}
cd ${ReleasePkgDir}
rm -f omc-md5sum.txt
# rpm --addsign *.rpm
md5sum ${DebPkgName} >omc-md5sum.txt
echo "Finish to make ${pkgtype} package <======="
;;
badeb)
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
ProcList="restagent crontask sshsvc captrace data2html"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
echo "Make $procName ..."
make
done
echo "Begin to make ${pkgtype} package ======>"
VersionID=`grep VERSION_ID /etc/os-release`
if [[ ${VersionID} =~ 'VERSION_ID="22.04"' ]]; then
@@ -274,9 +241,17 @@ case "${pkgtype}" in
DebBuildOMCDir=${DebBuild2204OMCDir}
DebFEBuildDir=${DebFEBuild2204Dir}
#DebPkgFile=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub22-ba.deb
DebPkgFile=${ProjectL}-r${RelVer}-ub22-ba.deb
elif [[ ${VersionID} =~ 'VERSION_ID="24.04"' ]]; then
DebBuildDir=${DebBuild2204Dir}
DebBuildOMCDir=${DebBuild2204OMCDir}
DebFEBuildDir=${DebFEBuild2204Dir}
DebPkgFile=${PROJECT}-r${RelVer}-ub24.deb
if [ ! $ProjectTag = "" ]; then
DebPkgFile=${ProjectL}-r${RelVer}-ub24-${ProjectTag}.deb
fi
elif [[ ${VersionID} =~ 'VERSION_ID="18.04"' ]]; then
DebPkgFile=${PROJECT}-r${VERSION}-${RelDate}-ub18-ba.deb
DebPkgFile=${ProjectL}-r${RelVer}-ub18-ba.deb
else
echo "Invalid OS release: ${VersionID}"
exit 1
@@ -292,17 +267,13 @@ case "${pkgtype}" in
rm -rf ${DebBuildOMCDir}/static/*
cp -rf ${RestagentDir}/${RESTAGENT} ${BuildOMCBinDir}
cp -rf ${CrontaskDir}/${CRONTASK} ${BuildOMCBinDir}
cp -rf ${SshSvcDir}/${SshSvcBin} ${BuildOMCBinDir}
cp -rf ${CapTraceDir}/${CapTraceBin} ${BuildOMCBinDir}
cp -rf ${Data2htmlDir}/${Data2htmlBin} ${BuildOMCBinDir}
cp -rf ${MiscDir}/* ${BuildOMCBinDir}
cp -rf ${ConfigEtcDir}/* ${BuildOMCEtcDir}
rm -rf ${BuildOMCEtcDir}/db/*
rm -rf ${BuildOMCEtcDir}/db && mkdir -p ${BuildOMCEtcDir}/db
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/install
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgrade
cp -rf ${BuildOMCEtcDir}/db/common/* ${BuildOMCEtcDir}/db/upgvue3
#Get SQL from database, overwrite from git
if [ "${dumpdb}" = "yes" ]; then
cd ${DumpToolDir}
@@ -318,16 +289,17 @@ case "${pkgtype}" in
cp -rf ${BuildDir}/* ${DebBuildDir}/
cp -rf ${CustomizedDir}/ba.d ${DebBuildOMCDir}/static
# replace Chinese character
find "${DebBuildOMCDir}/etc/db" -type f -name '*.sql' -exec sed -i 's/[一-龥]//g' {} +
find "${DebBuildOMCDir}/etc/db" -type f -name '*.sql' -exec sed -i 's/[一-龥()“”,。?!]~·]//g' {} +
echo "Replace all chinese character."
chmod +x ${DebBuildDir}/usr/local/omc/bin
sed -i "s/YYYYMMDD/${RelDate}/g" ${DebBuildDir}/DEBIAN/control
perl -0777 -i -pe 's/ne:\n user: root/ne:\n user: omcuser/g' ${DebBuildDir}/usr/local/omc/etc/default/restconf.yaml
ReleasePkgDir=${ReleaseDir}/debs/${RelArch}
dpkg -b ${DebBuildDir} ${ReleasePkgDir}/${DebPkgFile}
cd ${ReleasePkgDir}
rm -f omc-md5sum.txt
md5sum ${DebPkgName} >omc-md5sum.txt
echo "Finish to make ${pkgtype} package <======"
;;
*)
usage

View File

@@ -11,6 +11,7 @@ usage() {
echo " -m, =be|fe|all be: only process back-end code, default if non input"
echo " fe: only process front-end code"
echo " all: process all include be and fe"
echo " -c, =ba ba: customized for BA OMC"
}
pkgtype=""
@@ -49,8 +50,11 @@ while getopts "m:r:c:d" option; do
be_args+=("-d")
;;
c)
pkgtype="badeb"
be_args+=("$pkgtype")
c_arg=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
if [ "${c_arg}" == "ba" ]; then
pkgtype="badeb"
be_args+=("${pkgtype}")
fi
;;
\?)
echo "Invalid option: -$OPTARG" >&2
@@ -66,36 +70,77 @@ if [ ! -d ${rootdir} ]; then
fi
bedir=${rootdir}/be.ems
fedir=${rootdir}/fe.ems.vue3
builddir=${rootdir}/build.ems
buildcustomized=${builddir}/customized
customizeddir=${buildcustomized}/${c_arg}.d
fedir=${rootdir}/fe.ems.vue3
feassetsdir=${fedir}/public
felocalesdir=${fedir}/src/i18n/locales
feconstantsdir=${fedir}/src/constants
fehooksdir=${fedir}/src/hooks
makefe() {
cd ${fedir}
# git checkout ${feassetsdir}
# git checkout ${felocalesdir}
# git checkout ${feconstantsdir}
# git checkout ${fehooksdir}
git pull
if [ "${pkgtype}" == "badeb" ]; then
cp -rf ${customizeddir}/images/background_light.jpg ${feassetsdir}/background/light.jpg
cp -rf ${customizeddir}/images/background_dark.jpg ${feassetsdir}/background/dark.jpg
cp -rf ${customizeddir}/locales/zh-CN.ts ${felocalesdir}/zh-CN.ts
find "${feconstantsdir}" -type f -name '*.ts' -exec sed -i 's/[一-龥()“”,。?!]~·]//g' {} +
find "${fehooksdir}" -type f -name '*.ts' -exec sed -i 's/[一-龥()“”,。?!]~·]//g' {} +
fi
# npm install --force --registry https://registry.npmmirror.com
npm install --registry https://registry.npmmirror.com
echo -n "Building front-end vue ... "
npm run build 1>/dev/null
if [ $? = 0 ]; then
echo "done"
fi
git checkout ${feassetsdir}
git checkout ${felocalesdir}
git checkout ${feconstantsdir}
git checkout ${fehooksdir}
}
makebe() {
cd ${builddir}
cd ${builddir}/bin
#chmod +x mkpkg.sh
EmsBEDir=${rootdir}/be.ems
ProcList="restagent sshsvc"
cd $EmsBEDir
for procName in $ProcList;do
cd $EmsBEDir/$procName
echo "Make $procName ..."
make
done
chmod +x build.sh
./build.sh ${be_args[@]}
}
post_makepkg() {
cd ${builddir}
git checkout debbuild/DEBIAN/
git checkout debbuild/22.04/DEBIAN/
}
case "${m_arg}" in
fe)
"fe")
makefe
;;
all)
;;
"all")
makefe
makebe
;;
be | *)
makebe
;;
makebe
post_makepkg
;;
"be" | "*")
makebe
post_makepkg
;;
esac

5
bin/nodejs.sh Executable file
View File

@@ -0,0 +1,5 @@
# copy to /etc/profile.d/ to set the environment variables for all users
# cp -f nodejs.sh /etc/profile.d/99-nodejs.sh
export PATH=/usr/local/bin:$PATH
export NODE_OPTIONS=--max-old-space-size=50000

View File

@@ -9,9 +9,9 @@ REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.defau
--
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'AGrand EMS', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024 千通科技', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2025 千通科技', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'AGrand EMS', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024 AGrandTech', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2025 AGrandTech', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
-- set internationalization switching to ON
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -9,9 +9,9 @@ REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.defau
--
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'BlueArcus EMS', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024 BlueArcus', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2025 BlueArcus', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'BlueArcus EMS', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024 BlueArcus', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2025 BlueArcus', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
-- set internationalization switching to ON
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

View File

@@ -0,0 +1,2 @@
export default {
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -9,9 +9,9 @@ REPLACE INTO `sys_config` VALUES (109, 'config.sys.i18nDefault', 'sys.i18n.defau
--
REPLACE INTO `sys_dict_data` VALUES (1660, 1660, 'config.sys.titleValue', 'OMC', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2024', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (1661, 1661, 'config.sys.copyrightValue', 'Copyright ©2025', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3660, 3660, 'config.sys.titleValue', 'OMC', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2024', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
REPLACE INTO `sys_dict_data` VALUES (3661, 3661, 'config.sys.copyrightValue', 'Copyright ©2025', 'i18n_en', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
-- set internationalization switching to ON
-- REPLACE INTO `omc_db`.`sys_role_menu` (`role_id`, `menu_id`) VALUES (2, 2122);

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -1,5 +1,5 @@
Package: OMC
Version: 2.2410.2-YYYYMMDD-mt
Version: 2.2508.1-YYYYMMDD-mt
Section: AGrandTech
Prioritt: optional
Architecture: amd64

View File

@@ -1,39 +1,26 @@
# !/bin/bash
#!/bin/bash
OMCRootDir=/usr/local/omc
SystemdRootDir=/lib/systemd/system
OMCEtcDir=${OMCRootDir}/etc
FERootDir=${OMCRootDir}/htdocs/front
X86Lib64Dir=/lib/x86_64-linux-gnu
OMCBinDir=${OMCRootDir}/bin
OMCStaticDir=${OMCRootDir}/static
UsrLocalBinDir=/usr/local/bin
OMCDaemon=omcd
NginxEtcDir=/etc/nginx
NginxConfDir=${NginxEtcDir}/conf.d
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
CFileList="restconf.yaml sshsvc.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 restagent.service"
echo " sudo systemctl start/stop/restart/status crontask.service"
echo " sudo systemctl start/stop/restart/status sshsvc.service"
echo " sudo systemctl start/stop/restart/status captrace.service"
echo " or run: "
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
echo ""
cd ${X86Lib64Dir}
chmod +rx libwireshark.so.15.0.12
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
chmod +rx libwiretap.so.12.0.12
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
chmod +rx libwsutil.so.13.1.0
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi
@@ -48,7 +35,7 @@ for CFile in ${CFileList}; do
else
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
if [ -e "${OMCBinDir}/upgconf.sh" ]; then
if [ -e "${OMCBinDir}/upgconf.sh" ] && [ "${CFile}" = "restconf.yaml" ]; then
${OMCBinDir}/upgconf.sh
fi
fi
@@ -114,18 +101,18 @@ 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}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
fi
done
# for LogoFile in ${LogoFileList}; do
# if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
# cp ${OMCStaticDir}/omc.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
else
echo "user omc exist";
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
# else
# echo "user omc exist";
# fi
if [ ! -e "${NginxConfDir}/omc.conf" ]; then
mkdir -p ${NginxConfDir}
@@ -138,9 +125,7 @@ systemctl daemon-reload
systemctl disable --now unattended-upgrades
systemctl enable restagent.service
systemctl enable crontask.service
systemctl enable sshsvc.service
systemctl enable captrace.service
systemctl daemon-reload
@@ -161,8 +146,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
echo -n "Starting OMC service ... "
systemctl start crontask.service
systemctl start sshsvc.service
systemctl start captrace.service
systemctl start restagent.service
echo "done"

View File

@@ -1,13 +1,5 @@
# !/bin/bash
X86Lib64Dir=/lib/x86_64-linux-gnu
rm -rf ${X86Lib64Dir}/libwireshark.so.15
rm -rf ${X86Lib64Dir}/libwireshark.so
rm -rf ${X86Lib64Dir}/libwiretap.so.12
rm -rf ${X86Lib64Dir}/libwiretap.so
rm -rf ${X86Lib64Dir}/libwsutil.so.13
rm -rf ${X86Lib64Dir}/libwsutil.so
#rm -rf /usr/local/omc
rm -rf /etc/nginx/conf.d/omc.conf
rm -f /usr/local/bin/omcd
@@ -17,15 +9,11 @@ systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi
systemctl disable restagent.service
systemctl disable crontask.service
systemctl disable sshsvc.service
systemctl disable captrace.service
systemctl daemon-reload

View File

@@ -4,9 +4,7 @@ systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi

View File

@@ -1,5 +1,5 @@
Package: OMC
Version: 2.2410.2-YYYYMMDD-mt
Version: 2.2508.1-YYYYMMDD-mt
Section: AGrandTech
Prioritt: optional
Architecture: amd64

View File

@@ -1,39 +1,26 @@
# !/bin/bash
#!/bin/bash
OMCRootDir=/usr/local/omc
SystemdRootDir=/lib/systemd/system
OMCEtcDir=${OMCRootDir}/etc
FERootDir=${OMCRootDir}/htdocs/front
X86Lib64Dir=/lib/x86_64-linux-gnu
OMCBinDir=${OMCRootDir}/bin
OMCStaticDir=${OMCRootDir}/static
UsrLocalBinDir=/usr/local/bin
OMCDaemon=omcd
NginxEtcDir=/etc/nginx
NginxConfDir=${NginxEtcDir}/conf.d
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
CFileList="restconf.yaml sshsvc.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 restagent.service"
echo " sudo systemctl start/stop/restart/status crontask.service"
echo " sudo systemctl start/stop/restart/status sshsvc.service"
echo " sudo systemctl start/stop/restart/status captrace.service"
echo " or run: "
echo " sudo /usr/local/omc/bin/omcsvc.sh start/stop/restart/status"
echo ""
cd ${X86Lib64Dir}
chmod +rx libwireshark.so.15.0.12
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
chmod +rx libwiretap.so.12.0.12
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
chmod +rx libwsutil.so.13.1.0
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi
@@ -48,21 +35,21 @@ for CFile in ${CFileList}; do
else
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
if [ -e "${OMCBinDir}/upgconf.sh" ]; then
if [ -e "${OMCBinDir}/upgconf.sh" ] && [ "${CFile}" = "restconf.yaml" ]; then
${OMCBinDir}/upgconf.sh
fi
fi
fi
done
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}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
fi
done
# for LogoFile in ${LogoFileList}; do
# if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
# cp ${OMCStaticDir}/omc.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;
@@ -82,9 +69,7 @@ systemctl daemon-reload
systemctl disable --now unattended-upgrades
systemctl enable restagent.service
systemctl enable crontask.service
systemctl enable sshsvc.service
systemctl enable captrace.service
systemctl daemon-reload
@@ -105,8 +90,6 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
echo -n "Starting OMC service ... "
systemctl start crontask.service
systemctl start sshsvc.service
systemctl start captrace.service
systemctl start restagent.service
echo "done"

View File

@@ -1,13 +1,5 @@
# !/bin/bash
X86Lib64Dir=/lib/x86_64-linux-gnu
rm -rf ${X86Lib64Dir}/libwireshark.so.15
rm -rf ${X86Lib64Dir}/libwireshark.so
rm -rf ${X86Lib64Dir}/libwiretap.so.12
rm -rf ${X86Lib64Dir}/libwiretap.so
rm -rf ${X86Lib64Dir}/libwsutil.so.13
rm -rf ${X86Lib64Dir}/libwsutil.so
#rm -rf /usr/local/omc
rm -rf /etc/nginx/conf.d/omc.conf
rm -f /usr/local/bin/omcd
@@ -17,15 +9,11 @@ systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi
systemctl disable restagent.service
systemctl disable crontask.service
systemctl disable sshsvc.service
systemctl disable captrace.service
systemctl daemon-reload

View File

@@ -4,9 +4,7 @@ systemctl daemon-reload
if systemctl list-units --type=service --all | grep -q 'restagent.service'; then
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
fi

101
pkg.sh Normal file
View File

@@ -0,0 +1,101 @@
#!/bin/bash
# front-end Catalog
WebDir=/root/omc.git/fe.ems.vue3
WebBranch=multi-tenant
BuildWeb=""
# back-end Catalog
ApiDir=/root/omc.git/be.ems
ApiBranch=multi-tenant
BuildApi=""
# Package Catalog
BuildDir=/root/omc.git/build.ems
BuildBranch=multi-tenant
# Default Version Value
VERSION="2.2508.1"
# usage
usage() {
echo "Usage: bash $0 [OPTION]"
echo
echo "Build Software Package OPTION:"
echo " -v Specify the version"
echo " --web Build Web ($WebDir) Branch ($WebBranch)"
echo " --api Build Api ($ApiDir) Branch ($ApiBranch)"
echo " -h Display this help message"
echo
exit 1
}
# Read command line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
-v) VERSION="$2"; shift 2 ;;
--web) BuildWeb="build"; shift ;;
--api) BuildApi="build"; shift ;;
*) usage ;;
esac
done
# =================== build branch
echo
cd $BuildDir
rm -rf debbuild/*
git checkout .
git pull
git checkout $BuildBranch
git pull
echo "===> build checkout directory: $BuildDir"
# =================== Web
echo
# Determine if --web is passed in
if [ -n "$BuildWeb" ]; then
cd $WebDir
git checkout .
git pull
git checkout $WebBranch
git pull
sed -i "s/VITE_APP_VERSION = .*/VITE_APP_VERSION = \"${VERSION}\"/g" $WebDir/.env.development
sed -i "s/VITE_APP_VERSION = .*/VITE_APP_VERSION = \"${VERSION}\"/g" $WebDir/.env.production
cp -rf $BuildDir/customized/ba.d/images/background_light.jpg $WebDir/public/background/light.jpg
cp -rf $BuildDir/customized/ba.d/images/background_dark.jpg $WebDir/public/background/dark.jpg
cp -rf $BuildDir/customized/ba.d/locales/zh-CN.ts $WebDir/src/i18n/locales/zh-CN.ts
npm install --registry https://registry.npmmirror.com
npm run build
echo "===> build web directory: $WebDir"
fi
# =================== Api
echo
# Determine if --api is passed in
if [ -n "$BuildApi" ]; then
cd $ApiDir
git checkout .
git pull
git checkout $ApiBranch
git pull
ProcList="restagent sshsvc"
for procName in $ProcList;do
cd $ApiDir/$procName
sed -i "s/VERSION = .*/VERSION = ${VERSION}/g" $ApiDir/$procName/makefile
echo "Make $procName ..."
make
done
echo "===> build api directory: $ApiDir"
fi
# =================== ba deb
echo
cd $BuildDir
sed -i "s/VERSION=.*/VERSION=${VERSION}/g" $BuildDir/bin/build.sh
sed -i "s/Version: .*/Version: ${VERSION}-YYYYMMDD-mt/g" $BuildDir/debbuild/DEBIAN/control
sed -i "s/Version: .*/Version: ${VERSION}-YYYYMMDD-mt/g" $BuildDir/debbuild/22.04/DEBIAN/control
sed -i "s/Version: .*/Version: ${VERSION}/g" $BuildDir/rpmbuild/SPECS/omc.spec
bash bin/build.sh badeb
# bash pkg.sh --web --api -v 2.2508.1
# bash pkg.sh --web --api

View File

@@ -8,7 +8,7 @@
Name: %{project_lname}
Summary: 5GC OMC
Version: 2.2410.2
Version: 2.2508.1
Release: %{release_date}
Vendor: omc
URL: https://www.omc.com/
@@ -33,20 +33,17 @@ chmod +rx ${RPM_BUILD_ROOT}/usr/lib64/*
OMCRootDir=/usr/local/omc
OMCEtcDir=${OMCRootDir}/etc
FERootDir=${OMCRootDir}/htdocs/front
UsrLib64Dir=/usr/lib64
OMCBinDir=${OMCRootDir}/bin
OMCStaticDir=${OMCRootDir}/static
UsrLocalBinDir=/usr/local/bin
OMCDaemon=omcd
NginxEtcDir=/etc/nginx
CFileList="restconf.yaml crontask.yaml tasks.yaml sshsvc.yaml capconf.yaml omc.conf"
CFileList="restconf.yaml sshsvc.yaml omc.conf"
LogoFileList="zh_brand.png zh_icon.png en_brand.png en_icon.png"
echo -n "Stopping OMC service ... "
systemctl stop restagent.service
systemctl stop crontask.service
systemctl stop sshsvc.service
systemctl stop captrace.service
echo "done"
for CFile in ${CFileList}; do
@@ -55,28 +52,23 @@ for CFile in ${CFileList}; do
else
# mv -f ${OMCEtcDir}/${CFile} ${OMCEtcDir}/${CFile}.bak
# cp -f ${OMCEtcDir}/default/${CFile} ${OMCEtcDir}
if [ -e "${OMCBinDir}/upgconf.sh" ]; then
if [ -e "${OMCBinDir}/upgconf.sh" ] && [ "${CFile}" = "restconf.yaml" ]; then
${OMCBinDir}/upgconf.sh
fi
fi
done
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}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
fi
done
#for LogoFile in ${LogoFileList}; do
# if [ ! -e "${OMCStaticDir}/logo/${LogoFile}" ]; then
# cp ${OMCStaticDir}/omc.d/logo/${LogoFile} ${OMCStaticDir}/logo;
# fi
#done
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
cd ${UsrLib64Dir}
if [ ! -e libwireshark.so.15 ]; then ln -s libwireshark.so.15.0.12 libwireshark.so.15; fi
if [ ! -e libwireshark.so ]; then ln -s libwireshark.so.15.0.12 libwireshark.so; fi
if [ ! -e libwiretap.so.12 ]; then ln -s libwiretap.so.12.0.12 libwiretap.so.12; fi
if [ ! -e libwiretap.so ]; then ln -s libwiretap.so.12.0.12 libwiretap.so; fi
if [ ! -e libwsutil.so.13 ]; then ln -s libwsutil.so.13.1.0 libwsutil.so.13; fi
if [ ! -e libwsutil.so ]; then ln -s libwsutil.so.13.1.0 libwsutil.so; fi
cd ${UsrLocalBinDir}
if [ ! -e ${OMCDaemon} ]; then ln -s ${OMCBinDir}/omcsvc.sh ${OMCDaemon}; fi
@@ -89,9 +81,7 @@ firewall-cmd --reload
systemctl daemon-reload
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
@@ -110,23 +100,13 @@ if [ "$M_PARAM" = "install" -o "$M_PARAM" = "upgrade" ]; then
fi
echo -n "Starting OMC service ... "
systemctl start captrace.service
systemctl start sshsvc.service
systemctl start crontask.service
systemctl start restagent.service
echo "done"
# 卸载时执行
%postun
UsrLocalBinDir=/usr/local/bin
UsrLib64Dir=/usr/lib64
cd ${UsrLib64Dir}
rm libwireshark.so.15
rm libwireshark.so
rm libwiretap.so.12
rm libwiretap.so
rm libwsutil.so.13
rm libwsutil.so
rm -f ${UsrLocalBinDir}/omcd
# setting firewall
@@ -138,25 +118,17 @@ firewall-cmd --reload
if [ "$1" = "0" ] ; then
sudo systemctl stop restagent.service
sudo systemctl stop crontask.service
sudo systemctl stop sshsvc.service
sudo systemctl stop captrace.service
#rm -rf /usr/local/omc
rm -rf /etc/nginx/conf.d/omc.conf
sudo systemctl disable restagent.service
sudo systemctl disable crontask.service
sudo systemctl disable sshsvc.service
sudo systemctl disable captrace.service
sudo systemctl daemon-reload
else
sudo systemctl daemon-reload
sudo systemctl stop restagent.service
sudo systemctl stop crontask.service
sudo systemctl stop sshsvc.service
sudo systemctl stop captrace.service
sudo systemctl start crontask.service
sudo systemctl start sshsvc.service
sudo systemctl start captrace.service
sudo systemctl start restagent.service
fi
@@ -179,11 +151,5 @@ fi
/usr/local/omc/static
#/etc/nginx/conf.d/omc.conf
/lib/systemd/system/restagent.service
/lib/systemd/system/crontask.service
/lib/systemd/system/sshsvc.service
/lib/systemd/system/captrace.service
/usr/lib64/libwireshark.so.15.0.12
/usr/lib64/libwiretap.so.12.0.12
/usr/lib64/libwsutil.so.13.1.0
/usr/local/bin/tshark