From ba36181d3a912822a4da80a9e286fe3c36b5f58f Mon Sep 17 00:00:00 2001 From: Samson-W Date: Thu, 20 Feb 2020 01:55:32 +0800 Subject: [PATCH] Modify audit method for 11.1 --- bin/hardening/11.1_warning_banners.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/hardening/11.1_warning_banners.sh b/bin/hardening/11.1_warning_banners.sh index 65f8e5d..9ef85c8 100755 --- a/bin/hardening/11.1_warning_banners.sh +++ b/bin/hardening/11.1_warning_banners.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# harbian audit 7/8/9 Hardening +# harbian audit 7/8/9 or CentOS8 Hardening # # @@ -21,6 +21,11 @@ FILES='/etc/motd /etc/issue /etc/issue.net' # This function will be called if the script status is on enabled / audit mode audit () { for FILE in $FILES; do + does_file_exist $FILE + if [ $FNRET != 0 ]; then + warn "$FILE does not exist" + continue + fi has_file_correct_ownership $FILE $USER $GROUP if [ $FNRET = 0 ]; then ok "$FILE has correct ownership"