#!/bin/bash #check the linx security module is loaded export LANG=c echo_fail() { echo -e "\\033[1;31m" "failed" } reset_color() { echo -en "\\033[0;39m" } if [ -z $1 ];then echo -e "Please input checked system's hostname\n" echo -e "example $0 jb1-his2\n" exit 1 fi HOSTNAME=$1 cd tmp/${HOSTNAME} grep '6.0.3' ${HOSTNAME}.etc.issue &>/dev/null if [ $? -eq 0 ];then grep mac ${HOSTNAME}.sys.kernel.security.linx &>/dev/null if [ $? -eq 0 ];then echo "The linx6.0.3 safety function is normal" else echo "The linx6.0.3 safety function abnormal" echo_fail fi else grep linx ${HOSTNAME}.lsmod &>/dev/null if [ $? -eq 0 ];then echo "The rocky4.2 or linx6.0.4 security module is loaded." else echo "The rocky4.2 or linx6.0.4 security module isn't loaded." echo_fail fi fi reset_color