diff options
author | asomers <asomers@FreeBSD.org> | 2017-04-01 16:22:07 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2017-04-01 16:22:07 +0000 |
commit | 937c9e440ed0bac9ae1331031a21b2aa75d72a8f (patch) | |
tree | 6451246f746ede56f9383975ec0231d1f9f2396c | |
parent | 2027cc4701f9bb86ad0608decd2f2c8950877632 (diff) | |
download | FreeBSD-src-937c9e440ed0bac9ae1331031a21b2aa75d72a8f.zip FreeBSD-src-937c9e440ed0bac9ae1331031a21b2aa75d72a8f.tar.gz |
MFC r313069:
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
-rwxr-xr-x | etc/periodic/daily/999.local | 7 | ||||
-rwxr-xr-x | etc/periodic/monthly/999.local | 7 | ||||
-rwxr-xr-x | etc/periodic/weekly/999.local | 7 |
3 files changed, 18 insertions, 3 deletions
diff --git a/etc/periodic/daily/999.local b/etc/periodic/daily/999.local index 3173475..eca04e5 100755 --- a/etc/periodic/daily/999.local +++ b/etc/periodic/daily/999.local @@ -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:" diff --git a/etc/periodic/monthly/999.local b/etc/periodic/monthly/999.local index 4e7c2b9..a017a69 100755 --- a/etc/periodic/monthly/999.local +++ b/etc/periodic/monthly/999.local @@ -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:" diff --git a/etc/periodic/weekly/999.local b/etc/periodic/weekly/999.local index 3951bb5..cc40c07 100755 --- a/etc/periodic/weekly/999.local +++ b/etc/periodic/weekly/999.local @@ -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:" |