Files
shell_sequencer/seqTemplate.sh

55 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
readonly toolName=mytool
# Already defined by sequencer.sh, but may be overwritten
#readonly seq_configName="${sq_scriptName:?}.cfg"
#readonly seq_configTemplate="${seq_origin:?}/${sq_configName:?}.example"
sq_aptOpt=
sq_config=0
seq_config() {
## Called once before executing steps.
## e.g. to source a config file manually:
#. "${seq_origin:?}/${seq_configName:?}"
## or to use sequencer api with profile config file support:
#if initSeqConfig -p "${seq_fileName:?}" "${seq_configTemplate:?}" ; then
## or to use sequencer api with global config file:
#if initSeqConfig "${seq_configName:?}" "${seq_configTemplate:?}" ; then
# sq_config=1
#else
# # End if no configuration file exists
# dry || return 1
#fi
## Apt cmdline option to suppress user interaction
interactive || sq_aptOpt="-y"
## Disable error checks if external scripts are used
## e.g. error on unbound variables
#disableErrorCheck
## Return of non zero value will abort the sequence
return 0
}
step_1_info() { echo "My custom step"; }
step_1_options() { echo "[OPTIONS]"; }
step_1_alias() { echo "begin"; }
step_1() {
info "Doing something for step ${1:-} ..."
warning "Command line arguments starting with argument 2: $*"
# Use exe for regular command
# Use exep "command" for commands containing pipes or redirects
exe ls
exep "dmesg | head"
}
# shellcheck disable=SC2034 # Appears unused
readonly sqr_minVersion=16
# shellcheck disable=SC1091 # Don't follow this source
. /usr/local/bin/sequencer.sh