From be74716f74039a231aac77f08b81f3dea98ace87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sat, 7 Oct 2023 20:03:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=93=8D=E4=BD=9C=20swap=20=E5=90=8E?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=20/etc/fstab=20=E6=98=AF=E5=90=A6=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install_panel.sh | 7 +++++++ scripts/uninstall_panel.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/scripts/install_panel.sh b/scripts/install_panel.sh index 037a3f9c..ac4d33db 100644 --- a/scripts/install_panel.sh +++ b/scripts/install_panel.sh @@ -163,6 +163,13 @@ Auto_Swap() { mkswap -f $swapFile swapon $swapFile echo "$swapFile swap swap defaults 0 0" >> /etc/fstab + + mount -a + if [ "$?" != "0" ]; then + echo -e $HR + echo "错误:检测到系统的 /etc/fstab 文件配置有误,请检查排除后重试,问题解决前勿重启系统。" + exit 1 + fi } Init_Panel() { diff --git a/scripts/uninstall_panel.sh b/scripts/uninstall_panel.sh index c7aea542..159719a9 100644 --- a/scripts/uninstall_panel.sh +++ b/scripts/uninstall_panel.sh @@ -49,6 +49,13 @@ Remove_Swap() { rm -f ${swapFile} sed -i '/swap/d' /etc/fstab fi + + mount -a + if [ "$?" != "0" ]; then + echo -e $HR + echo "错误:检测到系统的 /etc/fstab 文件配置有误,请检查排除后重试,问题解决前勿重启系统。" + exit 1 + fi } Remove_Panel() {