diff options
author | Yoann Vandoorselaere <yoann@mandriva.com> | 1999-12-19 21:36:30 +0000 |
---|---|---|
committer | Yoann Vandoorselaere <yoann@mandriva.com> | 1999-12-19 21:36:30 +0000 |
commit | 1fc64881efb19aa39393441c65705b638116db5f (patch) | |
tree | b218d811559b48907558afd37ffc7453a228323c | |
parent | 70bff0370792d81bc1c82d5707beae4324c95c1a (diff) | |
download | msec-1fc64881efb19aa39393441c65705b638116db5f.tar msec-1fc64881efb19aa39393441c65705b638116db5f.tar.gz msec-1fc64881efb19aa39393441c65705b638116db5f.tar.bz2 msec-1fc64881efb19aa39393441c65705b638116db5f.tar.xz msec-1fc64881efb19aa39393441c65705b638116db5f.zip |
*** empty log message ***
-rwxr-xr-x | cron-sh/security_check.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cron-sh/security_check.sh b/cron-sh/security_check.sh index b4842b2..5b961bd 100755 --- a/cron-sh/security_check.sh +++ b/cron-sh/security_check.sh @@ -15,6 +15,7 @@ if [[ ${CHECK_SECURITY} != yes ]]; then exit 0 fi +INFOS=`mktemp /tmp/secure.XXXXXX` SECURITY=`mktemp /tmp/secure.XXXXXX` SECURITY_LOG="/var/log/security.log" TMP=`mktemp /tmp/secure.XXXXXX` @@ -251,11 +252,10 @@ done ### Dump a list of open port. if [[ ${CHECK_OPEN_PORT} == yes ]]; then - netstat -pvlA inet > ${TMP}; - if [[ -s ${TMP} ]]; then - printf "\nThese are the ports listening on your machine :\n" >> ${SECURITY} - cat ${TMP} >> ${SECURITY} + if [[ -s ${OPEN_PORT_TODAY} ]]; then + printf "\nThese are the ports listening on your machine :\n" >> ${INFOS} + cat ${OPEN_PORT_TODAY} >> ${INFOS} fi fi @@ -267,6 +267,7 @@ if [[ -s ${SECURITY} ]]; then date=`date` echo -e "\n\n*** Security Check, ${date} ***\n" >> ${SECURITY_LOG} cat ${SECURITY} >> ${SECURITY_LOG} + cat ${INFOS} >> ${SECURITY_LOG} fi if [[ -f ${SECURITY} ]]; then @@ -277,5 +278,10 @@ if [[ -f ${TMP} ]]; then rm -f ${TMP} fi +if [[ -f ${INFOS} ]]; then + rm -f ${INFOS}; +fi + + |