From db64dd8ce975bdfdfe400e9d68f46d0137aba516 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 18 Mar 2025 17:36:17 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=9E=84=E5=BB=BA=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/linux/usr/local/etc/omc/script/setup.sh | 8 +++----- build/pkg/deb/DEBIAN/postinst | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/build/linux/usr/local/etc/omc/script/setup.sh b/build/linux/usr/local/etc/omc/script/setup.sh index b5ff685f..51942e99 100644 --- a/build/linux/usr/local/etc/omc/script/setup.sh +++ b/build/linux/usr/local/etc/omc/script/setup.sh @@ -78,7 +78,7 @@ fi if [ -n "$M_PARAM" ]; then # Check that mode is within the standard range if [[ "$M_PARAM" != "standard" && "$M_PARAM" != "lite" ]]; then - echo "Error: -m can only be 'standard' or 'lite'." + echo "Error: M_PARAM can only be 'standard' or 'lite'." exit 1 fi sed -i "s/MODE=.*/MODE=${M_PARAM}/" $VariableFile @@ -91,7 +91,7 @@ fi if [ -n "$C_PARAM" ]; then # Check if customize is within the standard if [[ "$C_PARAM" != "omc" && "$C_PARAM" != "agt" && "$C_PARAM" != "ba" ]]; then - echo "Error: -c can only be 'omc', 'agt' or 'ba'." + echo "Error: C_PARAM can only be 'omc', 'agt' or 'ba'." exit 1 fi sed -i "s/VENDORS=.*/VENDORS=${C_PARAM}/" $VariableFile @@ -101,9 +101,7 @@ fi # ========================= if [[ "$T_PARAM" == "install" && "$MODE" == "standard" ]]; then - if command -v mysql &> /dev/null || command -v mariadb &> /dev/null; then - echo "MySQL or MariaDB installed" - else + if ! command -v mysql &> /dev/null && ! command -v mariadb &> /dev/null; then echo "MySQL or MariaDB not installed" exit 1 fi diff --git a/build/pkg/deb/DEBIAN/postinst b/build/pkg/deb/DEBIAN/postinst index 257f5592..e65cee55 100644 --- a/build/pkg/deb/DEBIAN/postinst +++ b/build/pkg/deb/DEBIAN/postinst @@ -27,7 +27,7 @@ if [ ! -f $RootDir/omc.conf ]; then fi if [ $? -ne 0 ]; then echo "Initialization failure." - dpkg --purge omc + rm -rf $RootDir exit 1 fi