1
0

9 Commits

15 changed files with 37 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
#!/bin/bash #!/usr/bin/env bash
set -e
# Check if Docker is installed # Check if Docker is installed
if command -v docker &> /dev/null; then if command -v docker &> /dev/null; then

View File

@@ -1,4 +1,5 @@
#!/bin/bash #!/usr/bin/env bash
set -e
# Default Version # Default Version
VERSION="1.0.0" VERSION="1.0.0"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
ServiceList="omc" ServiceList="omc"
BinDir="/usr/local/bin" BinDir="/usr/local/bin"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
declare -A NE_LIST declare -A NE_LIST
# Default network element number ne_id = 001 # Default network element number ne_id = 001
@@ -32,15 +32,16 @@ UPF,172.16.5.190,33030
# UPF,172.16.15.190,33030 # UPF,172.16.15.190,33030
# " # "
# Default SSH info # SSH info
DEFAULT_SSH_USER="manager" DEFAULT_SSH_USER="manager"
DEFAULT_SSH_PORT=22 DEFAULT_SSH_PORT=22
# If you already have a password-free authorization, please set the password to "" # If you already have a password-free authorization
# Please set the password to ""
#DEFAULT_SSH_PWD="" #DEFAULT_SSH_PWD=""
DEFAULT_SSH_PWD="bSQ21KY7cjn58JNkZ0UZM64EbSIPMQwfCTmzk3MTBvQ=" # admin123 DEFAULT_SSH_PWD="bSQ21KY7cjn58JNkZ0UZM64EbSIPMQwfCTmzk3MTBvQ=" # admin123
# 5gc+omc use local 127.0.0.1 # 5gc+omc use local 127.0.0.1
DEFAULT_SSH_LOCAL=false DEFAULT_SSH_LOCAL=false
# Default ne_host info # ne_host info
DEFAULT_TELNET_PORT=4100 DEFAULT_TELNET_PORT=4100
DEFAULT_TELNET_PORT2=5002 DEFAULT_TELNET_PORT2=5002
DEFAULT_REDIS_PORT=6379 DEFAULT_REDIS_PORT=6379
@@ -65,7 +66,7 @@ generate_ne_info() {
local ne_name="${ne_type}_${ne_id}" local ne_name="${ne_type}_${ne_id}"
local ne_rmuid="4400HX${ne_type}${ne_id}" local ne_rmuid="4400HX${ne_type}${ne_id}"
echo "INSERT INTO ne_info VALUES (${row_id}, '${ne_type}', '${ne_id}', '${ne_rmuid}', '${ne_name}', '${ip}', ${port}, 'PNF', '-', '-', '-', '-', '${ne_host}', 1, '', '', 0, 'script', $(date +%s%3N));" echo "INSERT INTO ne_info VALUES (${row_id}, '${ne_type}', '${ne_id}', '${ne_rmuid}', '${ne_name}', "2", 'http', '${ip}', ${port}, 'PNF', '-', '-', '-', '-', '${ne_host}', 1, '', 'script', $(date +%s%3N), 'script', $(date +%s%3N));"
} }
# ne_host # ne_host
@@ -142,7 +143,7 @@ generate_ne_license() {
local ne_type=$2 local ne_type=$2
local ne_id=$3 local ne_id=$3
echo "INSERT INTO ne_license VALUES (${row_id}, '${ne_type}', '${ne_id}', '', '', 0, '', '', '1', '', 'script', $(date +%s%3N), 'script', $(date +%s%3N));" echo "INSERT INTO ne_license VALUES (${row_id}, '${ne_type}', '${ne_id}', '', '', '', '', 0, 0, '1', '', 'script', $(date +%s%3N), 'script', $(date +%s%3N));"
} }

View File

@@ -1 +1 @@
#!/bin/bash #!/usr/bin/env bash

View File

@@ -1,4 +1,5 @@
#!/bin/bash #!/usr/bin/env bash
set -e
OMCBinFile=/usr/local/bin/omc OMCBinFile=/usr/local/bin/omc
OMCEtcDir=/usr/local/etc/omc OMCEtcDir=/usr/local/etc/omc

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Defining a list of SSH # Defining a list of SSH
# ssh_user,ssh_ip # ssh_user,ssh_ip

View File

@@ -1,4 +1,5 @@
#!/bin/bash #!/usr/bin/env bash
set -e
# front-end Catalog # front-end Catalog
WebDir=/root/omc.git/fe.ems.vue3 WebDir=/root/omc.git/fe.ems.vue3

View File

@@ -1,4 +1,5 @@
#!/bin/bash #!/usr/bin/env bash
set -e
# front-end Catalog # front-end Catalog
WebDir=/root/omc.git/fe.ems.vue3 WebDir=/root/omc.git/fe.ems.vue3
@@ -54,6 +55,9 @@ if [ -n "$BuildWeb" ]; then
git checkout $WebBranch git checkout $WebBranch
git pull 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
# RemoveChinese # RemoveChinese
rm -rf ./public/alarmHelp/zh rm -rf ./public/alarmHelp/zh
rm -rf ./public/nbStateImput/zh.xlsx rm -rf ./public/nbStateImput/zh.xlsx

6
pkg.sh
View File

@@ -1,4 +1,5 @@
#!/bin/bash #!/usr/bin/env bash
set -e
# front-end Catalog # front-end Catalog
WebDir=/root/omc.git/fe.ems.vue3 WebDir=/root/omc.git/fe.ems.vue3
@@ -55,6 +56,9 @@ if [ -n "$BuildWeb" ]; then
git checkout $WebBranch git checkout $WebBranch
git pull 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
# remote replication # remote replication
#scpDir=/root/omc.git/fe.ems.vue3 #scpDir=/root/omc.git/fe.ems.vue3
#scp -r -P 18422 root@192.168.9.58:$scpDir/dist $WebDir/ #scp -r -P 18422 root@192.168.9.58:$scpDir/dist $WebDir/

View File

@@ -48,6 +48,9 @@ else
cp -rf $RootDir/default/omc.yaml $RootDir/omc.yaml cp -rf $RootDir/default/omc.yaml $RootDir/omc.yaml
fi fi
# Stop Service
systemctl daemon-reload
systemctl stop omc.service
bash $RootDir/script/setup.sh -u bash $RootDir/script/setup.sh -u
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Upgrade failed." echo "Upgrade failed."

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# shellcheck disable=SC1091 # shellcheck disable=SC1091
set -o errexit set -o errexit

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# shellcheck disable=SC1091 # shellcheck disable=SC1091
set -o errexit set -o errexit

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
OMC_CONTAINER_NAME="omc" OMC_CONTAINER_NAME="omc"
MYSQL_CONTAINER_NAME="omc_mariadb" MYSQL_CONTAINER_NAME="omc_mariadb"

View File

@@ -80,6 +80,9 @@ else
cp -rf $RootDir/default/omc.yaml $RootDir/omc.yaml cp -rf $RootDir/default/omc.yaml $RootDir/omc.yaml
fi fi
# Stop Service
systemctl daemon-reload
systemctl stop omc.service
bash $RootDir/script/setup.sh -u bash $RootDir/script/setup.sh -u
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Upgrade failed." echo "Upgrade failed."