correct removal of old files with `--force`
`rm` would fail when one of the files is not present, which is quite undesirable log (not harmful until `set -e` is introduced).
This commit is contained in:
parent
d5efaf95c3
commit
a56efc9534
|
@ -177,7 +177,9 @@ function _create_keys() {
|
|||
exit 1
|
||||
else
|
||||
_log 'info' "Overwriting existing files as the '--force' option was supplied"
|
||||
rm "${PUBLIC_KEY_FILE}" "${PUBLIC_KEY_DNS_FILE}" "${PRIVATE_KEY_FILE}"
|
||||
[[ -f ${PUBLIC_KEY_FILE} ]] && rm "${PUBLIC_KEY_FILE}"
|
||||
[[ -f ${PUBLIC_KEY_DNS_FILE} ]] && rm "${PUBLIC_KEY_DNS_FILE}"
|
||||
[[ -f ${PRIVATE_KEY_FILE} ]] && rm "${PRIVATE_KEY_FILE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue