From 02913e042d00ffa76b9de3f593e66e9585b3dc94 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 25 May 2021 11:33:08 +0200 Subject: [PATCH] create modular prolog and epilog setup all files named [0-9][0-9]* in /opt/SGE/local/scripts/{prolog,epilog,pe_prolog,pe_epilog}.d and in /usr/local/etc/gridengine/{prolog,epilog,pe_prolog,pe_epilog}.d will be executed. --- bin/epilog | 1 + bin/pe_epilog | 1 + bin/pe_prolog | 1 + bin/pro-epilog_wrapper.sh | 20 ++++++++++++++++++++ bin/prolog | 1 + pe_epilog.d/.gitkeep | 0 pe_prolog.d/.gitkeep | 0 prolog.d/.gitkeep | 0 8 files changed, 24 insertions(+) create mode 120000 bin/epilog create mode 120000 bin/pe_epilog create mode 120000 bin/pe_prolog create mode 100755 bin/pro-epilog_wrapper.sh create mode 120000 bin/prolog create mode 100644 pe_epilog.d/.gitkeep create mode 100644 pe_prolog.d/.gitkeep create mode 100644 prolog.d/.gitkeep diff --git a/bin/epilog b/bin/epilog new file mode 120000 index 0000000..c8c77cf --- /dev/null +++ b/bin/epilog @@ -0,0 +1 @@ +pro-epilog_wrapper.sh \ No newline at end of file diff --git a/bin/pe_epilog b/bin/pe_epilog new file mode 120000 index 0000000..c8c77cf --- /dev/null +++ b/bin/pe_epilog @@ -0,0 +1 @@ +pro-epilog_wrapper.sh \ No newline at end of file diff --git a/bin/pe_prolog b/bin/pe_prolog new file mode 120000 index 0000000..c8c77cf --- /dev/null +++ b/bin/pe_prolog @@ -0,0 +1 @@ +pro-epilog_wrapper.sh \ No newline at end of file diff --git a/bin/pro-epilog_wrapper.sh b/bin/pro-epilog_wrapper.sh new file mode 100755 index 0000000..5f69c9e --- /dev/null +++ b/bin/pro-epilog_wrapper.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin + +FILES="" +SCRIPTNAME=$(basename $0) +DIRS="/opt/SGE/local/scripts/${SCRIPTNAME}.d /usr/local/etc/gridengine/${SCRIPTNAME}.d" +for DIR in ${DIRS} ; do + if [ -d ${DIR} ] ; then + if [ ! -z $(ls ${DIR}/[0-9][0-9]*) ] ; then + FILES="${FILES} $(ls ${DIR}/[0-9][0-9]*)" + fi + fi +done +FILESSORTED="$(echo ${FILES} | sort)" + +for FILE in ${FILESSORTED} ; do + echo ${FILE} || exit $? +done +exit 0 diff --git a/bin/prolog b/bin/prolog new file mode 120000 index 0000000..c8c77cf --- /dev/null +++ b/bin/prolog @@ -0,0 +1 @@ +pro-epilog_wrapper.sh \ No newline at end of file diff --git a/pe_epilog.d/.gitkeep b/pe_epilog.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/pe_prolog.d/.gitkeep b/pe_prolog.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/prolog.d/.gitkeep b/prolog.d/.gitkeep new file mode 100644 index 0000000..e69de29