Output error if step_config fails
Small enhancement of the template
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
VERSION_REV=12
|
VERSION_REV=12
|
||||||
VERSION_MAJOR=2
|
VERSION_MAJOR=2
|
||||||
VERSION_MINOR=0
|
VERSION_MINOR=1
|
||||||
|
|
||||||
## Start of generic script part
|
## Start of generic script part
|
||||||
|
|
||||||
@@ -816,11 +816,13 @@ CONFIG_FILE_NAME="\${SCRIPT_NAME}.cfg"
|
|||||||
CONFIG_FILE_TEMPLATE="\$WDIR/\${CONFIG_FILE_NAME}.example"
|
CONFIG_FILE_TEMPLATE="\$WDIR/\${CONFIG_FILE_NAME}.example"
|
||||||
|
|
||||||
step_config() {
|
step_config() {
|
||||||
echo "Called once before executing steps."
|
## Called once before executing steps.
|
||||||
## e.g. to source a config file manually:
|
## e.g. to source a config file manually:
|
||||||
#. "\$CONFIG_FILE"
|
#. "\$CONFIG_FILE"
|
||||||
|
|
||||||
## or to use sequencer api with global config file:
|
## or to use sequencer api with global config file:
|
||||||
#initSeqConfig "\$CONFIG_FILE_NAME" "\$CONFIG_FILE_TEMPLATE"
|
#initSeqConfig "\$CONFIG_FILE_NAME" "\$CONFIG_FILE_TEMPLATE"
|
||||||
|
|
||||||
## or to use sequencer api with profile config file support:
|
## or to use sequencer api with profile config file support:
|
||||||
#initSeqConfig -p "\$SCRIPT_NAME" "\$CONFIG_FILE_TEMPLATE"
|
#initSeqConfig -p "\$SCRIPT_NAME" "\$CONFIG_FILE_TEMPLATE"
|
||||||
#if [ \$? -eq 0 ] ; then
|
#if [ \$? -eq 0 ] ; then
|
||||||
@@ -829,7 +831,11 @@ step_config() {
|
|||||||
# # End if no configuration file exists
|
# # End if no configuration file exists
|
||||||
# [ \$DRY -eq 0 ] && return -1
|
# [ \$DRY -eq 0 ] && return -1
|
||||||
#fi
|
#fi
|
||||||
#[ \$QUIET -ne 0 ] && APTOPT="-y"
|
|
||||||
|
## Apt cmdline option to suppress user interaction
|
||||||
|
[ \$QUIET -ne 0 ] && APTOPT="-y"
|
||||||
|
|
||||||
|
## Return of non zero value will abort the sequence
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1101,7 +1107,7 @@ main() {
|
|||||||
|
|
||||||
parseAlias
|
parseAlias
|
||||||
|
|
||||||
# run configuration for seq only if available and if first step is valid
|
# run configuration for sequence only if available and if first step is valid
|
||||||
existsFunction step_config
|
existsFunction step_config
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
if [ $SEQ_CONFIG_EDIT -ne 0 ] ; then
|
if [ $SEQ_CONFIG_EDIT -ne 0 ] ; then
|
||||||
@@ -1112,9 +1118,12 @@ main() {
|
|||||||
fi
|
fi
|
||||||
checkStep "${START[0]}"
|
checkStep "${START[0]}"
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
if [ $QUIET -ne 2 ] ; then echo " [I] Configuring sequence (step_config) ..." ; fi
|
echoseq " [I] Configuring sequence (step_config)"
|
||||||
step_config "${STEP_ARGS[@]}"
|
step_config "${STEP_ARGS[@]}"
|
||||||
[ $? -ne 0 ] && exit 1
|
if [ $? -ne 0 ]; then
|
||||||
|
echoerr " [E] Configuring sequence failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user