update function
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user