added --after command to pass script
parent
1eabc4f7ae
commit
041a46c851
|
@ -20,7 +20,13 @@ now=$(date +%s)
|
||||||
function process_args() {
|
function process_args() {
|
||||||
while (( "$#" ))
|
while (( "$#" ))
|
||||||
do
|
do
|
||||||
case $1 in
|
case "$1" in
|
||||||
|
|
||||||
|
## --after <command> Run a command after a successful pass (default: none)
|
||||||
|
'--after')
|
||||||
|
after="${2}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
## --freq <frequency> (default: 137M)
|
## --freq <frequency> (default: 137M)
|
||||||
'--freq')
|
'--freq')
|
||||||
|
@ -64,7 +70,7 @@ do
|
||||||
satellite='noaa-19'
|
satellite='noaa-19'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
## --dir <path> Directory to place data (default: ./<month>/<day>)
|
## --dir <path> Directory to place data (default: ./<year>/<month>/<day>)
|
||||||
'--dir')
|
'--dir')
|
||||||
output_path=${2}
|
output_path=${2}
|
||||||
shift
|
shift
|
||||||
|
@ -145,7 +151,7 @@ if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# -- Do work below here --
|
# -- Do work below here --
|
||||||
process_args $@
|
process_args "${@}"
|
||||||
|
|
||||||
# -- Default Values --
|
# -- Default Values --
|
||||||
output_path=${output_path:=$(get_default_dir ${now})}
|
output_path=${output_path:=$(get_default_dir ${now})}
|
||||||
|
@ -179,3 +185,15 @@ fi
|
||||||
|
|
||||||
# Generate website
|
# Generate website
|
||||||
wxrx web $(generate_website_flags)
|
wxrx web $(generate_website_flags)
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
logerr "Errors occurred generating website"
|
||||||
|
exit 30
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -nz "${after}" ]; then
|
||||||
|
log "Running --after command: %s" "${after}"
|
||||||
|
${after} || {
|
||||||
|
logerr "Failed to run command after a successful pass: %s" "${after}"
|
||||||
|
exit 41
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue