Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2017 23:22:54 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313069 - in head/etc/periodic: daily monthly weekly
Message-ID:  <201702012322.v11NMspn046862@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Wed Feb  1 23:22:54 2017
New Revision: 313069
URL: https://svnweb.freebsd.org/changeset/base/313069

Log:
  Allow 999.local to run scripts in any language
  
  If one of the scripts listed in (daily|weekly|monthly)_local is executable,
  999.local should simply execute it. Only if the script isn't executable
  should 999.local assume it needs /bin/sh.
  
  Reviewed by:	brian
  MFC after:	3 weeks
  Sponsored by:	Spectra Logic Corp

Modified:
  head/etc/periodic/daily/999.local
  head/etc/periodic/monthly/999.local
  head/etc/periodic/weekly/999.local

Modified: head/etc/periodic/daily/999.local
==============================================================================
--- head/etc/periodic/daily/999.local	Wed Feb  1 22:03:59 2017	(r313068)
+++ head/etc/periodic/daily/999.local	Wed Feb  1 23:22:54 2017	(r313069)
@@ -20,7 +20,12 @@ do
     echo ''
     case "$script" in
 	/*)
-	    if [ -f "$script" ]
+	    if [ -x "$script" ]
+	    then
+		echo "Running $script:"
+
+		$script || rc=3
+	    elif [ -f "$script" ]
 	    then
 		echo "Running $script:"
 

Modified: head/etc/periodic/monthly/999.local
==============================================================================
--- head/etc/periodic/monthly/999.local	Wed Feb  1 22:03:59 2017	(r313068)
+++ head/etc/periodic/monthly/999.local	Wed Feb  1 23:22:54 2017	(r313069)
@@ -17,7 +17,12 @@ do
     echo ''
     case "$script" in
 	/*)
-	    if [ -f "$script" ]
+	    if [ -x "$script" ]
+	    then
+		echo "Running $script:"
+
+		$script || rc=3
+	    elif [ -f "$script" ]
 	    then
 		echo "Running $script:"
 

Modified: head/etc/periodic/weekly/999.local
==============================================================================
--- head/etc/periodic/weekly/999.local	Wed Feb  1 22:03:59 2017	(r313068)
+++ head/etc/periodic/weekly/999.local	Wed Feb  1 23:22:54 2017	(r313069)
@@ -17,7 +17,12 @@ do
     echo ''
     case "$script" in
 	/*)
-	    if [ -f "$script" ]
+	    if [ -x "$script" ]
+	    then
+		echo "Running $script:"
+
+		$script || rc=3
+	    elif [ -f "$script" ]
 	    then
 		echo "Running $script:"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702012322.v11NMspn046862>