From d103c3632ce4756fda27ebe95307af4736a62229 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 22 May 2025 18:35:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8D=87=E7=BA=A7=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=94=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/deb/DEBIAN/postinst | 7 +++++++ pkg/rpm/SPECS/omc.spec | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/deb/DEBIAN/postinst b/pkg/deb/DEBIAN/postinst index 9304d9e..035d371 100644 --- a/pkg/deb/DEBIAN/postinst +++ b/pkg/deb/DEBIAN/postinst @@ -40,6 +40,13 @@ if [ ! -f $RootDir/machine.ini ]; then systemctl restart sshsvc.service else # Operation when upgrading + if [ ! -f $RootDir/omc.conf ]; then + chmod +rx /usr/local/bin/omc + cp $RootDir/default/omc.conf $RootDir/omc.conf + cp $RootDir/default/omc.yaml $RootDir/omc.yaml + cp $RootDir/default/sshsvc.yaml $RootDir/sshsvc.yaml + cp $RootDir/web/default/config.js $RootDir/web/config.js + fi bash $RootDir/script/setup.sh -u if [ $? -ne 0 ]; then diff --git a/pkg/rpm/SPECS/omc.spec b/pkg/rpm/SPECS/omc.spec index df3514c..9860b0e 100644 --- a/pkg/rpm/SPECS/omc.spec +++ b/pkg/rpm/SPECS/omc.spec @@ -42,7 +42,7 @@ echo " firewall-cmd --zone=public --remove-port=80/tcp --permanent && firewal echo "" # Check if this is the first installation or upgrade -if [ ! -f $RootDir/omc.conf ]; then +if [ ! -f $RootDir/machine.ini ]; then # First installation, perform the related operations chmod +rx /usr/local/bin/omc cp $RootDir/default/omc.conf $RootDir/omc.conf @@ -72,6 +72,13 @@ if [ ! -f $RootDir/omc.conf ]; then systemctl restart sshsvc.service else # Operation when upgrading + if [ ! -f $RootDir/omc.conf ]; then + chmod +rx /usr/local/bin/omc + cp $RootDir/default/omc.conf $RootDir/omc.conf + cp $RootDir/default/omc.yaml $RootDir/omc.yaml + cp $RootDir/default/sshsvc.yaml $RootDir/sshsvc.yaml + cp $RootDir/web/default/config.js $RootDir/web/config.js + fi bash $RootDir/script/setup.sh -u if [ $? -ne 0 ]; then