Skip to content
Snippets Groups Projects
Commit 1c8b247e authored by Torbjörn Lönnemark's avatar Torbjörn Lönnemark
Browse files

new_host.sh: Fail early when ipa is unreachable

parent 2f4c3e2a
Branches
No related tags found
No related merge requests found
...@@ -37,6 +37,10 @@ if [ "${#MISSING_TOOLS[@]}" -gt 0 ]; then ...@@ -37,6 +37,10 @@ if [ "${#MISSING_TOOLS[@]}" -gt 0 ]; then
exit 1 exit 1
fi fi
# Silence standard messages but not errors
# (ipa ping prints "IPA server version X. API version Y" on success)
ipa ping > /dev/null || { printf "\nFreeIPA connection check (ipa ping) failed. Do you have a valid kerberos ticket? (run klist to check, or kinit get a new ticket). See previous errors for details.\n" | fold --spaces; exit 1; }
cd "${BASH_SOURCE[0]%/*}" || { echo "Failed to change working directory to script dir"; exit 1; } cd "${BASH_SOURCE[0]%/*}" || { echo "Failed to change working directory to script dir"; exit 1; }
TEMP_DIR=$(mktemp -d /dev/shm/new_host.XXXXXXXX) TEMP_DIR=$(mktemp -d /dev/shm/new_host.XXXXXXXX)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment