perf: 重构目录结构

This commit is contained in:
TsMask
2025-03-14 18:25:41 +08:00
parent 9befa00fd4
commit b3bb2d788f
430 changed files with 7167 additions and 12958 deletions

View File

@@ -0,0 +1,9 @@
Package: OMC
Version: {version}-{date}
Section: OMC-Team
Prioritt: optional
Architecture: {arch}
Maintainer: OMC-Team
Depends:
Description:
OMC is a management application for the 5GC core network.

View File

@@ -0,0 +1,31 @@
# !/bin/bash
# 安装后执行脚本
RootDir=/usr/local/etc/omc
# 执行安装后配置
echo ""
echo "Output: $RootDir"
echo "Please Run:"
echo " sudo systemctl start|stop|status|restart omc.service"
echo ""
# 检查是否是第一次安装或是升级
if [ ! -f $RootDir/omc.yaml ]; then
# 第一次安装,执行相关操作
chmod +rx /usr/local/bin/omc
cp $RootDir/default/omc.conf $RootDir/omc.conf
cp $RootDir/default/omc.yaml $RootDir/omc.yaml
cp $RootDir/default/sshsvc.yaml $RootDir/sshsvc.yaml
systemctl daemon-reload
systemctl enable omc.service
systemctl enable sshsvc.service
systemctl daemon-reload
systemctl restart omc.service
systemctl restart sshsvc.service
else
# 升级时的操作
systemctl daemon-reload
systemctl start omc.service
systemctl start sshsvc.service
fi

View File

@@ -0,0 +1,23 @@
# !/bin/bash
# 卸载后执行脚本
case "$1" in
remove)
# 卸载操作
# 删除服务文件
systemctl daemon-reload
systemctl disable omc.service
systemctl disable sshsvc.service
rm -rf /lib/systemd/system/omc.service
rm -rf /lib/systemd/system/sshsvc.service
systemctl daemon-reload
# 移除相关文件
rm -rf /usr/local/bin/omc
rm -rf /usr/local/etc/omc
;;
upgrade)
# 更新操作
;;
esac

View File

@@ -0,0 +1,4 @@
# !/bin/bash
# 安装前执行脚本
rm -rf /usr/local/etc/omc/default

View File

@@ -0,0 +1,7 @@
# !/bin/bash
# 卸载前执行脚本
# 停止服务
systemctl daemon-reload
systemctl stop omc.service
systemctl stop sshsvc.service