Only alter fstab if needed
This commit is contained in:
parent
42754613df
commit
267851bd89
|
@ -124,7 +124,11 @@ function defrag_filesystem {
|
|||
}
|
||||
|
||||
function optimise_filesystem {
|
||||
if grep -q "btrfs" /etc/fstab; then
|
||||
if ! grep -q "btrfs defaults,subvol=@,compress=lzo,ssd" /etc/fstab; then
|
||||
sed -i 's|btrfs subvol=@|btrfs defaults,subvol=@,compress=lzo,ssd|g' /etc/fstab
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# NOTE: deliberately no exit 0
|
||||
|
|
Loading…
Reference in New Issue