forked from evolix/evocheck
OpenBSD - check_mountfstab and check_mount : make sure all mounted partitions are in fstab and all partitions in fstab are mounted
This commit is contained in:
parent
da28729577
commit
011c62f984
|
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
* Log output and runtime config to /var/log/evocheck.log.
|
* Log output and runtime config to /var/log/evocheck.log.
|
||||||
|
* check_mountfstab and check_mount : make sure all mounted partitions are in fstab and all partitions in fstab are mounted
|
||||||
|
|
||||||
## [23.02] - 2023-02-10
|
## [23.02] - 2023-02-10
|
||||||
|
|
||||||
|
|
|
@ -526,6 +526,17 @@ check_root_user() {
|
||||||
failed "IS_ROOT_USER" "root user should not have a password ; replace the password field with 'vipw' for the root user with '*************' (exactly 13 asterisks) "
|
failed "IS_ROOT_USER" "root user should not have a password ; replace the password field with 'vipw' for the root user with '*************' (exactly 13 asterisks) "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
check_mount(){
|
||||||
|
for fstab_entry in $(grep ffs /etc/fstab | grep -v "^#" | awk '{print $2}'); do
|
||||||
|
echo "$(mount | awk '{print $3}')" | grep -q "^$fstab_entry$" || failed "IS_MOUNT" "Local OpenBSD partition(s) detected in /etc/fstab but not mounted"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
check_mountfstab() {
|
||||||
|
for mount_point in $(mount | awk '{print $3}'); do
|
||||||
|
grep -q " $mount_point " /etc/fstab || failed "IS_MOUNT_FSTAB" "Partition(s) detected mounted but no presence in /etc/fstab"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
# Default return code : 0 = no error
|
# Default return code : 0 = no error
|
||||||
|
@ -575,6 +586,8 @@ main() {
|
||||||
test "${IS_EVOLIX_USER:=1}" = 1 && check_evolix_user
|
test "${IS_EVOLIX_USER:=1}" = 1 && check_evolix_user
|
||||||
test "${IS_CHECK_VERSIONS:=1}" = 1 && check_versions
|
test "${IS_CHECK_VERSIONS:=1}" = 1 && check_versions
|
||||||
test "${IS_ROOT_USER:=1}" = 1 && check_root_user
|
test "${IS_ROOT_USER:=1}" = 1 && check_root_user
|
||||||
|
test "${IS_MOUNT:=1}" = 1 && check_mount
|
||||||
|
test "${IS_MOUNT_FSTAB:=1}" = 1 && check_mountfstab
|
||||||
|
|
||||||
exit ${RC}
|
exit ${RC}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue