Skip to content

Commit

Permalink
avoid running checks if conditions aren't met
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Murdaca <[email protected]>
  • Loading branch information
runcom authored and nullr0ute committed Sep 8, 2022
1 parent 483cff9 commit 2c0ac48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions usr/lib/greenboot/check/required.d/01_repository_dns_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ if [[ ! -d $REPOS_DIRECTORY ]]; then
exit 1
fi

if [ -z "$(ls -A $REPOS_DIRECTORY)" ]; then
echo "${REPOS_DIRECTORY} is empty, skipping check"
exit 0
fi

get_domain_names_from_platform_urls
if [[ -n $DOMAIN_NAMES ]]; then
get_dns_resolution_from_domain_names
Expand Down
5 changes: 5 additions & 0 deletions usr/lib/greenboot/check/required.d/02_watchdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ check_if_current_boot_is_wd_triggered() {
fi
}

if ! check_if_there_is_a_watchdog ; then
echo "No watchdog on the system, skipping check"
exit 0
fi

# This is in order to test check_if_current_boot_is_wd_triggered
# function within a container
if [ "${1}" != "--source-only" ]; then
Expand Down

0 comments on commit 2c0ac48

Please sign in to comment.