Skip to content

Commit

Permalink
setup: certs: attempt to make the target directory
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Jun 17, 2020
1 parent ffd50a5 commit 386ea97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@ generate_certificates() (

# update host to trust registry certificate
if ! cmp --quiet "$STATEDIR/certs/ca.pem" "$certs_dir/tinkerbell.crt"; then
if [ ! -d "$certs_dir/tinkerbell.crt" ]; then
# The user will be told to create the directory
# in the next block, if copying the certs there
# fails.
mkdir -p "$certs_dir" || true > /dev/null 2>&1
fi
if ! cp "$STATEDIR/certs/ca.pem" "$certs_dir/tinkerbell.crt"; then
echo "$ERR please copy $STATEDIR/certs/ca.pem to $certs_dir/tinkerbell.crt"
echo "$BLANK and run $0 again:"
Expand Down

0 comments on commit 386ea97

Please sign in to comment.