# platform = multi_platform_all
# reboot = false

# Include source function library.
. /usr/share/scap-security-guide/remediation_functions

populate {{{ MOUNTPOINT }}}

include_mount_options_functions

function perform_remediation {
	# test "$mount_has_to_exist" = 'yes'
	if test "{{{ MOUNT_HAS_TO_EXIST }}}" = 'yes'; then
		assert_mount_point_in_fstab "${{{ MOUNTPOINT }}}" || { echo "Not remediating, because there is no record of ${{{ MOUNTPOINT }}} in /etc/fstab" >&2; return 1; }
	fi

	ensure_mount_option_in_fstab "${{{ MOUNTPOINT }}}" "{{{ MOUNTOPTION }}}"

	ensure_partition_is_mounted "${{{ MOUNTPOINT }}}"
}

perform_remediation
