mirror of
https://github.com/raymond999999/shell.git
synced 2026-03-12 17:51:35 +08:00
Fourth change to reset script file on February 10, 2025.
This commit is contained in:
@@ -184,7 +184,7 @@ disable_selinux(){
|
||||
}
|
||||
|
||||
set_swap(){
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
${COLOR}"${OS_ID} ${OS_RELEASE} swap已被禁用,不用设置!"${END}
|
||||
else
|
||||
sed -ri.bak '/swap/s/(.*)(defaults)(.*)/\1\2,noauto\3/g' /etc/fstab
|
||||
|
||||
@@ -226,7 +226,7 @@ disable_selinux(){
|
||||
}
|
||||
|
||||
set_swap(){
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
${COLOR}"${OS_ID} ${OS_RELEASE} swap已被禁用,不用设置!"${END}
|
||||
else
|
||||
sed -ri.bak '/swap/s/(.*)(defaults)(.*)/\1\2,noauto\3/g' /etc/fstab
|
||||
|
||||
@@ -324,7 +324,7 @@ disable_selinux(){
|
||||
}
|
||||
|
||||
set_swap(){
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
${COLOR}"${OS_ID} ${OS_RELEASE} swap已被禁用,不用设置!"${END}
|
||||
else
|
||||
sed -ri.bak '/swap/s/(.*)(defaults)(.*)/\1\2,noauto\3/g' /etc/fstab
|
||||
|
||||
@@ -315,7 +315,7 @@ disable_apparmor(){
|
||||
}
|
||||
|
||||
set_swap(){
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
${COLOR}"${OS_ID} ${OS_RELEASE} swap已被禁用,不用设置!"${END}
|
||||
else
|
||||
sed -ri.bak '/swap/s/(.*)(defaults)(.*)/\1\2,noauto\3/g' /etc/fstab
|
||||
|
||||
@@ -1738,7 +1738,7 @@ disable_selinux(){
|
||||
}
|
||||
|
||||
set_swap(){
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
${COLOR}"${OS_ID} ${OS_RELEASE} swap已被禁用,不用设置!"${END}
|
||||
else
|
||||
if [ ${OS_ID} == "Rocky" -o ${OS_ID} == "AlmaLinux" -o ${OS_ID} == "CentOS" ];then
|
||||
|
||||
@@ -2693,7 +2693,7 @@ disable_selinux(){
|
||||
}
|
||||
|
||||
set_swap(){
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
if grep -Eqi "noauto" /etc/fstab;then
|
||||
${COLOR}"${OS_ID} ${OS_RELEASE} swap已被禁用,不用设置!"${END}
|
||||
else
|
||||
if [ ${OS_ID} == "Rocky" -o ${OS_ID} == "AlmaLinux" -o ${OS_ID} == "CentOS" ];then
|
||||
|
||||
Reference in New Issue
Block a user