From 83fa22a72a1d48e9720790cbe90c6d13c08ba92e Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Fri, 4 Sep 2020 15:36:51 +0200 Subject: [PATCH] IS_VARTMPFS: use findmnt if available --- CHANGELOG | 1 + evocheck.sh | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7ebb07b..2056ae2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp * IS_EVOBACKUP_EXCLUDE_MOUNT: exclude disabled backup scripts * IS_DUPLICATE_FS_LABEL: disable blkid cache * IS_POSTGRES_BACKUP: look for compressed backup too +* IS_VARTMPFS: use findmnt if available ### Deprecated diff --git a/evocheck.sh b/evocheck.sh index ff375bf..9234059 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -205,10 +205,13 @@ check_customsudoers() { grep -E -qr "umask=0077" /etc/sudoers* || failed "IS_CUSTOMSUDOERS" "missing umask=0077 in sudoers file" } check_vartmpfs() { - df /var/tmp | grep -q tmpfs || failed "IS_VARTMPFS" "/var/tmp is not a tmpfs" -} -check_vartmpfs() { - df /var/tmp | grep -q tmpfs || failed "IS_VARTMPFS" "/var/tmp is not a tmpfs" + FINDMNT_BIN=$(command -v findmnt) + if [ -x "${FINDMNT_BIN}" ]; then + ${FINDMNT_BIN} /var/tmp --type tmpfs --noheadings > /dev/null || failed "IS_VARTMPFS" "/var/tmp is not a tmpfs" + else + df /var/tmp | grep -q tmpfs || failed "IS_VARTMPFS" "/var/tmp is not a tmpfs" + fi + } check_serveurbase() { is_installed serveur-base || failed "IS_SERVEURBASE" "serveur-base package is not installed"