wxrx/wxrx.sh

75 lines
1.4 KiB
Bash
Raw Normal View History

2022-07-06 16:57:31 -07:00
#!/usr/bin/env bash
2022-01-31 16:14:26 -08:00
##
## __PROG__ <command> [-h|--help] ...
prog="$0"
2022-02-02 07:27:26 -08:00
me=${HELP:-`basename "$prog"`}
2022-01-31 16:14:26 -08:00
rootdir=$(dirname $(realpath $0))
source ${rootdir}/lib/utils.sh
# <command> is required
if [ -z "${1}" ]; then
logerr "A command is required"
usage
exit 1
fi
command=${1}
2022-02-02 07:27:26 -08:00
command_help="${me} ${command}"
2022-01-31 16:14:26 -08:00
## Commands:
2022-02-02 07:27:26 -08:00
case "$command" in
2022-01-31 16:14:26 -08:00
## help Show this help message
'help' | '-h' | '--help')
usage
exit
;;
## predict Predict future passes
'predict')
shift
2022-02-02 07:27:26 -08:00
HELP=$command_help ${rootdir}/predict_passes.sh $@
2022-01-31 16:14:26 -08:00
;;
## record Demodulate and record a signal
'record')
shift
HELP=$command_help ${rootdir}/record.sh $@
2022-01-31 16:14:26 -08:00
;;
## decode Decode images from a recorded APT signal
'decode')
shift
HELP=$command_help ${rootdir}/decode.sh $@
2022-01-31 16:14:26 -08:00
;;
2022-02-02 15:38:12 -08:00
## web Generate website files from decoded manifests
'web')
shift
HELP=$command_help ${rootdir}/generate_website.sh $@
;;
2022-01-31 16:14:26 -08:00
## pass Capture and decode a pass occuring NOW
'pass')
2022-07-06 16:48:53 -07:00
shift
HELP=$command_help ${rootdir}/run_station.sh $@
2022-01-31 16:14:26 -08:00
;;
## update Update satellite telemetry
'update')
shift
2022-02-02 07:27:26 -08:00
HELP=$command_help ${rootdir}/update_satellites.sh $@
2022-01-31 16:14:26 -08:00
;;
2022-02-02 07:27:26 -08:00
2022-01-31 16:14:26 -08:00
## schedule Schedule a future pass with `atd`
'schedule')
2022-07-06 16:48:53 -07:00
shift
HELP=$command_help ${rootdir}/schedule.sh $@
2022-01-31 16:14:26 -08:00
;;
'*')
logerr "Unrecognized command ${1}"
usage
exit 1
esac