52 lines
1.5 KiB
Bash
Executable File
52 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
readonly toolName=mytool
|
|
|
|
# Get script working directory
|
|
# (when called from a different directory and even when called via symlink)
|
|
readonly sq_dir="$(cd "$(dirname -- "$(realpath ${BASH_SOURCE[0]})")" >>/dev/null 2>&1 && pwd)"
|
|
readonly sq_scriptFile=$(basename -- $0)
|
|
readonly sq_scriptName=${sq_scriptFile%%.*}
|
|
readonly sq_configFileName="${sq_scriptName}.cfg"
|
|
readonly sq_configFileTemplate="$sq_dir/${sq_configFileName}.example"
|
|
sq_aptOpt=
|
|
sq_config=0
|
|
|
|
step_config() {
|
|
## Called once before executing steps.
|
|
## e.g. to source a config file manually:
|
|
#. "$sq_config_FILE"
|
|
|
|
## or to use sequencer api with profile config file support:
|
|
#initSeqConfig -p "$sq_scriptName" "$sq_configFileTemplate"
|
|
|
|
## or to use sequencer api with global config file:
|
|
#initSeqConfig "$sq_configFileName" "$sq_configFileTemplate"
|
|
#if [ $? -eq 0 ] ; then
|
|
# sq_config=1
|
|
#else
|
|
# # End if no configuration file exists
|
|
# [ $DRY -eq 0 ] && return -1
|
|
#fi
|
|
|
|
## Apt cmdline option to suppress user interaction
|
|
[ $QUIET -ne 0 ] && sq_aptOpt="-y"
|
|
|
|
## Return of non zero value will abort the sequence
|
|
return 0
|
|
}
|
|
|
|
step_1_info() { echoinfoArgs "[OPTIONS]"; echo "My custom step"; }
|
|
step_1_alias() { echo "begin"; }
|
|
step_1() {
|
|
echo "Doing something for step $1 ..."
|
|
echo "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"
|
|
}
|
|
|
|
VERSION_SEQREV=16
|
|
. /usr/local/bin/sequencer.sh
|