24 lines
377 B
Plaintext
24 lines
377 B
Plaintext
function Apply(){
|
|
ExitError=$1
|
|
shift
|
|
Step=$1
|
|
shift
|
|
Txt=$1
|
|
shift
|
|
Cmd=$@
|
|
eval $@
|
|
GetRes=$?
|
|
if [[ $GetRes -ne 0 ]] && [[ ExitError -eq 1 ]]
|
|
then
|
|
echo "Fatal Error on step ${Step} : $Cmd"
|
|
exit 10
|
|
else
|
|
[[ $GetRes -ne 0 ]] && echo "WARNING on step ${Step}" || true
|
|
fi
|
|
|
|
}
|
|
# Export de la fonction pour être pris en compte dans les sous shell
|
|
|
|
export -f Apply
|
|
|