1
0

fix: 更新脚本以支持远程数据库配置和修复文件路径

This commit is contained in:
TsMask
2025-05-21 10:20:02 +08:00
parent 46bc90c2e4
commit 2f5031cbd4
5 changed files with 22 additions and 16 deletions

View File

@@ -9,6 +9,7 @@ source $VariableFile
# Initializing variables
T_PARAM=""
R_PARAM=false
C_PARAM=""
M_PARAM=""
@@ -19,6 +20,7 @@ usage() {
echo "Program Initialization OPTION:"
echo " -i, --install Specify the install"
echo " -u, --upgrade Specify the upgrade"
echo " -r, --remote Specify the remote database"
echo " -m, --mode Available the mode (std/lite)"
echo " -c, --customize Available the customize (omc/agt/ba)"
echo " -h Display this help message"
@@ -38,9 +40,9 @@ while [[ $# -gt 0 ]]; do
T_PARAM="upgrade"
shift
;;
-t|--type)
T_PARAM="$2"
shift 2 # 跳过 -t 参数和值
-r|--remote)
R_PARAM=true
shift
;;
-m|--mode)
M_PARAM="$2"
@@ -97,9 +99,12 @@ fi
if [[ "$T_PARAM" == "install" ]]; then
case "$MODE" in
std)
if ! command -v mysql &>/dev/null && ! command -v mariadb &>/dev/null; then
echo "MySQL or MariaDB not installed"
exit 1
# Check if MySQL or MariaDB is installed when not a remote database
if [ "$R_PARAM" = false ]; then
if ! command -v mysql &>/dev/null && ! command -v mariadb &>/dev/null; then
echo "MySQL or MariaDB not installed"
exit 1
fi
fi
;;
lite)