2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 18:27:13 +08:00

feat: 操作 swap 后检查 /etc/fstab 是否正确

This commit is contained in:
耗子
2023-10-07 20:03:29 +08:00
parent fdfe5725fd
commit be74716f74
2 changed files with 14 additions and 0 deletions

View File

@@ -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() {

View File

@@ -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() {