From f1c63f827ff3b223c32c8d97e0199fa2b157cb2c Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Fri, 17 Sep 2021 17:15:19 +0200 Subject: [PATCH] Fixed check_tmoutprofile and changed version numbering --- CHANGELOG | 10 ++++++++++ evocheck.sh | 8 ++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 372840a..cf4955b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [21.09] - 2021-09-17 + +### Changed + +- Changed version numbering to use year.month and be capable to know the age of the script + +### Fixed + +- Fixed check_tmoutprofile : Add "if" to check if file exists + ## [6.9.1] - 2021-07-23 ### Changed diff --git a/evocheck.sh b/evocheck.sh index f0800d5..a0853d1 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -3,7 +3,7 @@ # EvoCheck # Script to verify compliance of an OpenBSD server powered by Evolix -readonly VERSION="6.9.1" +readonly VERSION="21.09" # Disable LANG* @@ -114,7 +114,11 @@ check_noatime(){ } check_tmoutprofile(){ - grep -q TMOUT= /etc/skel/.profile /root/.profile || failed "IS_TMOUTPROFILE" "In order to fix, add 'export TMOUT=36000' to both /etc/skel/.profile and /root/.profile files" + if [ -f /etc/skel/.profile ] + grep -q TMOUT= /etc/skel/.profile /root/.profile || failed "IS_TMOUTPROFILE" "In order to fix, add 'export TMOUT=36000' to both /etc/skel/.profile and /root/.profile files" + else + failed "IS_TMOUTPROFILE" "File /etc/skel/.profile does not exist. Both /etc/skel/.profile and /root/.profile should contain at least 'export TMOUT=36000'" + fi } check_raidok(){