bootstrap_cache: validate action param

This commit is contained in:
Lyndon Brown 2020-04-01 02:19:43 +01:00 committed by Luca Boccassi
parent 314ca3d56a
commit 1716958a8d
1 changed files with 6 additions and 2 deletions

View File

@ -24,14 +24,18 @@ Init_config_data "${@}"
# Check architecture
Check_crossarchitectures
if ! In_list "bootstrap" ${LB_CACHE_STAGES}
then
if ! In_list "bootstrap" ${LB_CACHE_STAGES}; then
exit 0
fi
_ACTION="${1}"
shift
if ! In_list "${_ACTION}" restore save; then
Echo_error "Invalid action parameter"
exit 1
fi
# Set non-default stage file name
# Note, this (plus the applicable extension added below) must match that used in `bootstrap_debootstrap`
STAGE_FILE="bootstrap_cache.${_ACTION}"