fix(crowsnest): uninstaller exited KIAUH if crowsnest not installed

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus
2023-08-26 18:31:37 +02:00
parent 2822499344
commit f45da66e9e

View File

@@ -117,18 +117,22 @@ function install_crowsnest(){
# Remove func # Remove func
function remove_crowsnest(){ function remove_crowsnest(){
if [[ -d "${CROWSNEST_DIR}" ]]; then
pushd "${HOME}/crowsnest" &> /dev/null || exit 1 pushd "${HOME}/crowsnest" &> /dev/null || exit 1
title_msg "Uninstaller will prompt you for sudo password!" title_msg "Uninstaller will prompt you for sudo password!"
status_msg "Launching crowsnest uninstaller ..." status_msg "Launching crowsnest uninstaller ..."
if ! make uninstall; then if ! make uninstall; then
error_msg "Something went wrong! Please try again..." error_msg "Something went wrong! Please try again..."
exit 1 exit 1
fi fi
if [[ -e "${CROWSNEST_DIR}" ]]; then
status_msg "Removing crowsnest directory ..." status_msg "Removing crowsnest directory ..."
rm -rf "${CROWSNEST_DIR}" rm -rf "${CROWSNEST_DIR}"
ok_msg "Directory removed!" ok_msg "Directory removed!"
fi fi
print_confirm "Crowsnest successfully removed!"
} }
# Status funcs # Status funcs