1
0

fix: 将配置中的 "standard" 修改为 "std"

This commit is contained in:
TsMask
2025-03-20 19:41:19 +08:00
parent e363529519
commit 874707cd00
5 changed files with 11 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ usage() {
echo "Program Initialization OPTION:"
echo " -i, --install Specify the install"
echo " -u, --upgrade Specify the upgrade"
echo " -m, --mode Available the mode (standard/lite)"
echo " -m, --mode Available the mode (std/lite)"
echo " -c, --customize Available the customize (omc/agt/ba)"
echo " -h Display this help message"
echo
@@ -69,21 +69,21 @@ fi
# Determine if -m is passed in
if [ -n "$M_PARAM" ]; then
# Check that mode is within the standard range
if [[ "$M_PARAM" != "standard" && "$M_PARAM" != "lite" ]]; then
echo "Error: M_PARAM can only be 'standard' or 'lite'."
# Check that mode is within the std range
if [[ "$M_PARAM" != "std" && "$M_PARAM" != "lite" ]]; then
echo "Error: M_PARAM can only be 'std' or 'lite'."
exit 1
fi
sed -i "s/MODE=.*/MODE=${M_PARAM}/" $VariableFile
sed -i "s/serverVersion: \"standard\"/serverVersion: \"${M_PARAM}\"/" $confFile
sed -i "/database:/,/defaultDataSourceName:/s/\"standard\"/\"${M_PARAM}\"/" $confFile
sed -i "s/serverVersion: \"std\"/serverVersion: \"${M_PARAM}\"/" $confFile
sed -i "/database:/,/defaultDataSourceName:/s/\"std\"/\"${M_PARAM}\"/" $confFile
MODE=$M_PARAM
fi
# echo "Mode parameter: $MODE"
# Determine if -c is passed in
if [ -n "$C_PARAM" ]; then
# Check if customize is within the standard
# Check if customize is within the omc/agt/ba range
if [[ "$C_PARAM" != "omc" && "$C_PARAM" != "agt" && "$C_PARAM" != "ba" ]]; then
echo "Error: C_PARAM can only be 'omc', 'agt' or 'ba'."
exit 1
@@ -94,7 +94,7 @@ fi
# echo "Customize parameter: $VENDORS"
# =========================
if [[ "$T_PARAM" == "install" && "$MODE" == "standard" ]]; then
if [[ "$T_PARAM" == "install" && "$MODE" == "std" ]]; then
if ! command -v mysql &> /dev/null || ! command -v mariadb &> /dev/null; then
echo "MySQL or MariaDB not installed"
exit 1
@@ -103,7 +103,7 @@ if [[ "$T_PARAM" == "install" && "$MODE" == "standard" ]]; then
rm -rf $OMCEtcDir/default/omc_db.sqlite
fi
if [[ "$T_PARAM" == "install" && "$MODE" == "lite" ]]; then
rm -rf $OMCEtcDir/database/standard
rm -rf $OMCEtcDir/database/std
cp -rf $OMCEtcDir/default/omc_db.sqlite $OMCEtcDir/database/omc_db.sqlite
fi
@@ -121,4 +121,4 @@ if [[ "$T_PARAM" == "upgrade" && -d $OMCEtcDir/vendor ]]; then
$OMCBinFile -c $confFile --sqlPath $OMCEtcDir/vendor/$VENDORS/database/$MODE/$T_PARAM --sqlSource $MODE
fi
# bash setup.sh -i -m standard -c omc
# bash setup.sh -i -m std -c omc