uprgade-keycloak.sh: some minor changes..
This commit is contained in:
parent
f3676c92af
commit
1b356ebce1
@ -1369,7 +1369,7 @@ blank_line
|
|||||||
|
|
||||||
echononl "Backup Keycloak Installation directory.."
|
echononl "Backup Keycloak Installation directory.."
|
||||||
if [[ -n "${OLD_INSTALL_DIR}" ]]; then
|
if [[ -n "${OLD_INSTALL_DIR}" ]]; then
|
||||||
cp -a "${OLD_INSTALL_DIR}" "${OLD_INSTALL_DIR}.${backup_date}" > "$log_file" 2>&1
|
mv "${OLD_INSTALL_DIR}" "${OLD_INSTALL_DIR}.${backup_date}" > "$log_file" 2>&1
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat "$log_file")"
|
error "$(cat "$log_file")"
|
||||||
@ -1381,12 +1381,16 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echononl "Remove Symlink '${KEYCLOAK_BASE_INSTALL_PATH}/keycloak' .."
|
echononl "Remove Symlink '${KEYCLOAK_BASE_INSTALL_PATH}/keycloak' .."
|
||||||
rm "${KEYCLOAK_BASE_INSTALL_PATH}/keycloak" > "$log_file" 2>&1
|
if [[ -h "${KEYCLOAK_BASE_INSTALL_PATH}/keycloak" ]] ; then
|
||||||
if [[ $? -ne 0 ]]; then
|
rm "${KEYCLOAK_BASE_INSTALL_PATH}/keycloak" > "$log_file" 2>&1
|
||||||
echo_failed
|
if [[ $? -ne 0 ]]; then
|
||||||
error "$(cat "$log_file")"
|
echo_failed
|
||||||
|
error "$(cat "$log_file")"
|
||||||
|
else
|
||||||
|
echo_ok
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo_ok
|
echo_skipped
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ blank_line
|
|||||||
|
|
||||||
echononl "Backup Keycloak Installation directory.."
|
echononl "Backup Keycloak Installation directory.."
|
||||||
if [[ -n "${CUR_INSTALL_DIR}" ]]; then
|
if [[ -n "${CUR_INSTALL_DIR}" ]]; then
|
||||||
cp -a "${CUR_INSTALL_DIR}" "${CUR_INSTALL_DIR}.${backup_date}" > "$log_file" 2>&1
|
mv "${CUR_INSTALL_DIR}" "${CUR_INSTALL_DIR}.${backup_date}" > "$log_file" 2>&1
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat "$log_file")"
|
error "$(cat "$log_file")"
|
||||||
@ -615,7 +615,7 @@ fi
|
|||||||
blank_line
|
blank_line
|
||||||
|
|
||||||
echononl "Copy 'conf/ directory from the previous installation to the new installation."
|
echononl "Copy 'conf/ directory from the previous installation to the new installation."
|
||||||
cp -a "${CUR_INSTALL_DIR}/conf" "${KEYCLOAK_INSTALL_DIR}/" > "$log_file" 2>&1
|
cp -a "${CUR_INSTALL_DIR}.${backup_date}/conf" "${KEYCLOAK_INSTALL_DIR}/" > "$log_file" 2>&1
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat "$log_file")"
|
error "$(cat "$log_file")"
|
||||||
@ -624,7 +624,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echononl "Copy 'providers/ directory from the previous installation to the new installation."
|
echononl "Copy 'providers/ directory from the previous installation to the new installation."
|
||||||
cp -a "${CUR_INSTALL_DIR}/providers" "${KEYCLOAK_INSTALL_DIR}/" > "$log_file" 2>&1
|
cp -a "${CUR_INSTALL_DIR}.${backup_date}/providers" "${KEYCLOAK_INSTALL_DIR}/" > "$log_file" 2>&1
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat "$log_file")"
|
error "$(cat "$log_file")"
|
||||||
@ -633,7 +633,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echononl "Copy 'themes/ directory from the previous installation to the new installation."
|
echononl "Copy 'themes/ directory from the previous installation to the new installation."
|
||||||
cp -a "${CUR_INSTALL_DIR}/themes" "${KEYCLOAK_INSTALL_DIR}/" > "$log_file" 2>&1
|
cp -a "${CUR_INSTALL_DIR}.${backup_date}/themes" "${KEYCLOAK_INSTALL_DIR}/" > "$log_file" 2>&1
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat "$log_file")"
|
error "$(cat "$log_file")"
|
||||||
@ -750,14 +750,29 @@ if [[ $? -ne 0 ]]; then
|
|||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat "$log_file")"
|
error "$(cat "$log_file")"
|
||||||
|
|
||||||
echononl "\033[1mcontinue anyway\033[m [yes/no]: "
|
if $terminal ; then
|
||||||
read OK
|
|
||||||
while [[ "${OK,,}" != "yes" ]] && [[ "${OK,,}" != "no" ]] ; do
|
|
||||||
echononl "Wrong entry! - repeat [yes/nno]: "
|
|
||||||
read OK
|
|
||||||
done
|
|
||||||
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
|
|
||||||
|
|
||||||
|
echononl "\033[1mcontinue anyway\033[m [yes/no]: "
|
||||||
|
read OK
|
||||||
|
while [[ "${OK,,}" != "yes" ]] && [[ "${OK,,}" != "no" ]] ; do
|
||||||
|
echononl "Wrong entry! - repeat [yes/nno]: "
|
||||||
|
read OK
|
||||||
|
done
|
||||||
|
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
echo_ok
|
||||||
|
fi
|
||||||
|
|
||||||
|
echononl "Wait 20 seconds for the keycloak service to be fully created."
|
||||||
|
echo_wait
|
||||||
|
sleep 20
|
||||||
|
${KEYCLOAK_BASE_INSTALL_PATH}/keycloak/bin/kc.sh show-config > "${working_dir}/current-configuration.txt" 2> "$log_file"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
echo_failed
|
||||||
|
error "$(cat "$log_file")"
|
||||||
else
|
else
|
||||||
echo_ok
|
echo_ok
|
||||||
fi
|
fi
|
||||||
@ -769,6 +784,26 @@ systemctl start keycloak.service > "$log_file" 2>&1
|
|||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo_failed
|
echo_failed
|
||||||
error "$(cat "$log_file")"
|
error "$(cat "$log_file")"
|
||||||
|
|
||||||
|
if $terminal ; then
|
||||||
|
|
||||||
|
echo " Perhaps it is enough to wait a moment and then start the:"
|
||||||
|
echo ""
|
||||||
|
echo " The command to start the keycloak service is:"
|
||||||
|
echo ""
|
||||||
|
echo -e " \033[33msystemctl start keycloak.service\033[m"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echononl "\033[1mcontinue anyway\033[m [yes/no]: "
|
||||||
|
read OK
|
||||||
|
while [[ "${OK,,}" != "yes" ]] && [[ "${OK,,}" != "no" ]] ; do
|
||||||
|
echononl "Wrong entry! - repeat [yes/nno]: "
|
||||||
|
read OK
|
||||||
|
done
|
||||||
|
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo_ok
|
echo_ok
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user