Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v17] NodeJoin Script: improve clean up message when using package manager #48877

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions lib/web/scripts/node-join/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,33 @@ log_important() {
log_cleanup_message() {
log_only "This script does not overwrite any existing settings or Teleport installations."
log_only "Please clean up by running any of the following steps as necessary:"
if is_using_systemd; then
log_only "- stop teleport's service"
log_only " - systemctl stop teleport"
fi
log_only "- stop any running Teleport processes"
log_only " - pkill -f teleport"
log_only "- remove any data under ${TELEPORT_DATA_DIR}, along with the directory itself"
log_only " - rm -rf ${TELEPORT_DATA_DIR}"
log_only "- remove any configuration at ${TELEPORT_CONFIG_PATH}"
log_only " - rm -f ${TELEPORT_CONFIG_PATH}"
log_only "- remove any Teleport binaries (${TELEPORT_BINARY_LIST}) installed under ${TELEPORT_BINARY_DIR}"
for BINARY in ${TELEPORT_BINARY_LIST}; do EXAMPLE_DELETE_COMMAND+="${TELEPORT_BINARY_DIR}/${BINARY} "; done
log_only " - rm -f ${EXAMPLE_DELETE_COMMAND}"
if check_exists apt; then
log_only "- remove teleport package"
log_only " - apt remove teleport"
elif check_exists yum; then
log_only "- remove teleport package"
log_only " - yum remove teleport"
elif check_exists dnf; then
log_only "- remove teleport package"
log_only " - dnf remove teleport"
elif check_exists zypper; then
log_only "- remove teleport package"
log_only " - zypper remove teleport"
else
log_only "- remove any Teleport binaries (${TELEPORT_BINARY_LIST}) installed under ${TELEPORT_BINARY_DIR}"
for BINARY in ${TELEPORT_BINARY_LIST}; do EXAMPLE_DELETE_COMMAND+="${TELEPORT_BINARY_DIR}/${BINARY} "; done
log_only " - rm -f ${EXAMPLE_DELETE_COMMAND}"
fi
if is_macos_host; then
log_only "- unload and remove Teleport launchd config ${LAUNCHD_CONFIG_PATH}/${LAUNCHD_PLIST_FILE}"
log_only " - launchctl unload ${LAUNCHD_CONFIG_PATH}/${LAUNCHD_PLIST_FILE}"
Expand Down
Loading