diff options
author | root <root@rshg047.dnsready.net> | 2011-04-20 05:15:36 +0000 |
---|---|---|
committer | root <root@rshg047.dnsready.net> | 2011-04-20 05:15:36 +0000 |
commit | 862a468489b5081755f9086204a012c7cd3beb3e (patch) | |
tree | 6ab46fa059be2927c621a1d526f6f95e6a4033e1 /community-testing/cronie/run-cron | |
parent | 8f4f6fea0e8f06647b3e06c003069c93b5b033b4 (diff) |
Wed Apr 20 05:15:36 UTC 2011
Diffstat (limited to 'community-testing/cronie/run-cron')
-rwxr-xr-x | community-testing/cronie/run-cron | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/community-testing/cronie/run-cron b/community-testing/cronie/run-cron new file mode 100755 index 000000000..5c62e3377 --- /dev/null +++ b/community-testing/cronie/run-cron @@ -0,0 +1,38 @@ +#!/bin/bash + +# run-parts - concept taken from Debian + +# keep going when something fails +set +e + +if [ $# -lt 1 ]; then + echo "Usage: run-parts <dir>" + exit 1 +fi + +if [ ! -d $1 ]; then + echo "Not a directory: $1" + exit 1 +fi + +# Ignore *~ and *, scripts +for i in $1/*[^~,] ; do + [ -d $i ] && continue + # Don't run *.{pacsave,pacorig,pacnew,swp} scripts + [ "${i%.pacsave}" != "${i}" ] && continue + [ "${i%.pacorig}" != "${i}" ] && continue + [ "${i%.pacnew}" != "${i}" ] && continue + [ "${i%.swp}" != "${i}" ] && continue + [ "${i%,v}" != "${i}" ] && continue + + if [ -x $i ]; then + $i 2>&1 | awk -v "progname=$i" \ + 'progname { + print progname ":\n" + progname=""; + } + { print; }' + fi +done + +exit 0 |