Skip to content

Commit

Permalink
Checks if configuration parameters are set.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hologos committed Jun 22, 2022
1 parent c8975e8 commit 80c5e3c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libs/flow
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ function fma::flow::preflight_checks() {
echo
echo "Pre-flight checks"

echo "› checking configuration"
fma::flow::check_configuration

echo "› checking interface ${affected_interface}"
fma::network::interface_exists "${affected_interface}"

Expand All @@ -28,4 +31,14 @@ function fma::flow::fake_mac_address() {
fma::network::check_mac_address_after "${affected_interface}" "${fake_mac_address}"
}

function fma::flow::check_configuration() {
if [[ -z "${affected_interface+x}" ]]; then
fma::utils::terminate "Configuration parametr [affected_interface] is not set."
fi

if [[ -z "${fake_mac_address+x}" ]]; then
fma::utils::terminate "Configuration parametr [fake_mac_address] is not set."
fi

fma::utils::success "Configuration is set."
}

0 comments on commit 80c5e3c

Please sign in to comment.