Skip to content

Commit

Permalink
update the installer to remove any existing update tracker state
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rister committed Feb 7, 2024
1 parent a05675b commit c83d305
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions crucible-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=bash

# Installer Settings
IDENTITY="/root/.crucible/identity"
USER_DIR="/root/.crucible"
IDENTITY="${USER_DIR}/identity"
SYSCONFIG="/etc/sysconfig/crucible"
DEPENDENCIES="podman git jq"
INSTALL_PATH="/opt/crucible"
Expand Down Expand Up @@ -159,6 +160,18 @@ function usage {
_USAGE_
}

# cleanup previous installation
function clean_old_install {
if [ -d $INSTALL_PATH ]; then
old_install_path="/opt/crucible-moved-on-`date +%d-%m-%Y_%H:%M:%S`"
echo "An existing installation of crucible exists and will be moved to $old_install_path"
/bin/mv "$INSTALL_PATH" "$old_install_path"
fi

# reset the update tracker if there is any existing state
rm -f "${USER_DIR}/update-status*" > /dev/null
}

# set name and email address
function identity {

Expand Down Expand Up @@ -301,11 +314,7 @@ if [ ! -z ${CRUCIBLE_CLIENT_SERVER_TLS_VERIFY+x} ]; then
fi
fi

if [ -d $INSTALL_PATH ]; then
old_install_path="/opt/crucible-moved-on-`date +%d-%m-%Y_%H:%M:%S`"
echo "An existing installation of crucible exists and will be moved to $old_install_path"
/bin/mv "$INSTALL_PATH" "$old_install_path"
fi
clean_old_install

echo "Installing crucible in $INSTALL_PATH"
echo "Using Git repo: ${GIT_REPO}"
Expand Down

0 comments on commit c83d305

Please sign in to comment.