feat: 数据升级工具配置文件读取初始厂商
This commit is contained in:
4
config/etc/default/omc.conf
Normal file
4
config/etc/default/omc.conf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
## Command Configuration
|
||||||
|
VENDORS=CoreNet_EMS
|
||||||
|
|
||||||
|
## Other
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Read the value of the variable from file
|
||||||
|
source /usr/local/omc/etc/omc.conf
|
||||||
|
|
||||||
C_ARG_LOWER="agt"
|
C_ARG_LOWER="agt"
|
||||||
C_ARG_UPPER="AGT"
|
C_ARG_UPPER="AGT"
|
||||||
M_ARG_LOWER="*"
|
M_ARG_LOWER="*"
|
||||||
@@ -10,9 +13,21 @@ check_args() {
|
|||||||
c)
|
c)
|
||||||
C_ARG_LOWER=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
|
C_ARG_LOWER=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
|
||||||
C_ARG_UPPER=$(echo $OPTARG | tr '[:lower:]' '[:upper:]')
|
C_ARG_UPPER=$(echo $OPTARG | tr '[:lower:]' '[:upper:]')
|
||||||
|
# Modifying Script Variables
|
||||||
|
if [ "${C_ARG_LOWER}" == "ba" ]; then
|
||||||
|
C_ARG_UPPER="BA"
|
||||||
|
sed -i 's/VENDORS=.*/VENDORS=BA/' /usr/local/omc/etc/omc.conf
|
||||||
|
elif [ "${C_ARG_LOWER}" == "agt" ]; then
|
||||||
|
C_ARG_UPPER="AGT"
|
||||||
|
sed -i 's/VENDORS=.*/VENDORS=AGT/' /usr/local/omc/etc/omc.conf
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
m)
|
m)
|
||||||
M_ARG=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
|
M_ARG=$(echo $OPTARG | tr '[:upper:]' '[:lower:]')
|
||||||
|
if [ "${VENDORS}" == "BA" ]; then
|
||||||
|
C_ARG_LOWER="ba"
|
||||||
|
C_ARG_UPPER="BA"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user