[Midnightbsd-cvs] src [11779] add security job

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jul 11 18:33:36 EDT 2018


Revision: 11779
          http://svnweb.midnightbsd.org/src/?rev=11779
Author:   laffer1
Date:     2018-07-11 18:33:35 -0400 (Wed, 11 Jul 2018)
Log Message:
-----------
add security job

Modified Paths:
--------------
    trunk/etc/periodic/monthly/999.local
    trunk/etc/periodic/monthly/Makefile

Added Paths:
-----------
    trunk/etc/periodic/monthly/450.status-security

Property Changed:
----------------
    trunk/etc/periodic/monthly/200.accounting
    trunk/etc/periodic/monthly/999.local

Index: trunk/etc/periodic/monthly/200.accounting
===================================================================
--- trunk/etc/periodic/monthly/200.accounting	2018-07-11 22:22:29 UTC (rev 11778)
+++ trunk/etc/periodic/monthly/200.accounting	2018-07-11 22:33:35 UTC (rev 11779)

Property changes on: trunk/etc/periodic/monthly/200.accounting
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Added: trunk/etc/periodic/monthly/450.status-security
===================================================================
--- trunk/etc/periodic/monthly/450.status-security	                        (rev 0)
+++ trunk/etc/periodic/monthly/450.status-security	2018-07-11 22:33:35 UTC (rev 11779)
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# $MidnightBSD$
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+    . /etc/defaults/periodic.conf
+    source_periodic_confs
+fi
+
+case "$monthly_status_security_enable" in
+    [Yy][Ee][Ss])
+	echo ""
+	echo "Security check:"
+
+	case "$monthly_status_security_inline" in
+	    [Yy][Ee][Ss])
+		monthly_status_security_output="";;
+	esac
+
+	export security_output="${monthly_status_security_output}"
+	rc=0
+	case "${monthly_status_security_output}" in
+	    "")
+		if tempfile=`mktemp ${TMPDIR:-/tmp}/450.status-security.XXXXXX`
+		then
+			periodic security > $tempfile || rc=3
+			if [ -s "$tempfile" ]; then
+				cat "$tempfile"
+				rc=3
+			fi
+			rm -f "$tempfile"
+		fi;;
+	    /*)
+		echo "    (output logged separately)"
+		periodic security || rc=3;;
+	    *)
+		echo "    (output mailed separately)"
+		periodic security || rc=3;;
+	esac;;
+    *)  rc=0;;
+esac
+
+exit $rc


Property changes on: trunk/etc/periodic/monthly/450.status-security
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/etc/periodic/monthly/999.local
===================================================================
--- trunk/etc/periodic/monthly/999.local	2018-07-11 22:22:29 UTC (rev 11778)
+++ trunk/etc/periodic/monthly/999.local	2018-07-11 22:33:35 UTC (rev 11779)
@@ -17,10 +17,15 @@
     echo ''
     case "$script" in
 	/*)
-	    if [ -f "$script" ]
+	    if [ -x "$script" ]
 	    then
 		echo "Running $script:"
 
+		$script || rc=3
+	    elif [ -f "$script" ]
+	    then
+		echo "Running $script:"
+
 		sh $script || rc=3
 	    else
 		echo "$script: No such file"


Property changes on: trunk/etc/periodic/monthly/999.local
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/etc/periodic/monthly/Makefile
===================================================================
--- trunk/etc/periodic/monthly/Makefile	2018-07-11 22:22:29 UTC (rev 11778)
+++ trunk/etc/periodic/monthly/Makefile	2018-07-11 22:33:35 UTC (rev 11779)
@@ -2,7 +2,8 @@
 
 .include <bsd.own.mk>
 
-FILES=	999.local
+FILES=	450.status-security \
+	999.local
 
 # NB: keep these sorted by MK_* knobs
 



More information about the Midnightbsd-cvs mailing list