refactoring

This commit is contained in:
Patrick Schleizer 2023-10-22 10:25:57 -04:00
parent d5cb7ecec9
commit ef69e512bd
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -79,9 +79,11 @@ remount_secure() {
## example status_file_full_path:
## /run/remount-secure/_home
mount_line_of_mount_folder="$(findmnt --noheadings "$mount_folder")" || true
old_mount_options="$(findmnt --noheadings --output options -- "$mount_folder")" || true
## example old_mount_options:
## rw,nosuid,nodev,relatime,discard
if echo "$mount_line_of_mount_folder" | grep --quiet "$new_mount_options" ; then
if echo "$old_mount_options" | grep --quiet "$new_mount_options" ; then
$output_command "INFO: $mount_folder has already intended mount options. ($new_mount_options)"
return 0
fi