From 79600c42df9fcc3edc93e03c1aa479744cc13b39 Mon Sep 17 00:00:00 2001 From: Brian Downs Date: Mon, 14 Dec 2020 15:41:39 -0700 Subject: [PATCH 1/4] remove unneeded rm and reorder yum call Signed-off-by: Brian Downs --- bundle/bin/rke2-uninstall.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bundle/bin/rke2-uninstall.sh b/bundle/bin/rke2-uninstall.sh index 348cd46432..3092d3e4c2 100755 --- a/bundle/bin/rke2-uninstall.sh +++ b/bundle/bin/rke2-uninstall.sh @@ -35,10 +35,9 @@ uninstall_disable_services() uninstall_remove_files() { if [ -r /etc/redhat-release ] || [ -r /etc/centos-release ] || [ -r /etc/oracle-release ]; then - rm -f /etc/yum.repos.d/rancher-rke2*.repo - rm -f /etc/sysconfig/rke2-server - yum remove -y rke2-* + + rm -f /etc/yum.repos.d/rancher-rke2*.repo fi find "${INSTALL_RKE2_ROOT}/lib/systemd/system" -name rke2-*.service -type f -delete From d2c293d403069a3e9c58c543f51bee8529157925 Mon Sep 17 00:00:00 2001 From: Brian Downs Date: Mon, 14 Dec 2020 16:37:05 -0700 Subject: [PATCH 2/4] quote path in rm call to prevent unnecessary globbing Signed-off-by: Brian Downs --- bundle/bin/rke2-uninstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/bin/rke2-uninstall.sh b/bundle/bin/rke2-uninstall.sh index 3092d3e4c2..58dc212b9d 100755 --- a/bundle/bin/rke2-uninstall.sh +++ b/bundle/bin/rke2-uninstall.sh @@ -37,7 +37,7 @@ uninstall_remove_files() if [ -r /etc/redhat-release ] || [ -r /etc/centos-release ] || [ -r /etc/oracle-release ]; then yum remove -y rke2-* - rm -f /etc/yum.repos.d/rancher-rke2*.repo + rm -f "/etc/yum.repos.d/rancher-rke2*.repo" fi find "${INSTALL_RKE2_ROOT}/lib/systemd/system" -name rke2-*.service -type f -delete From cd0f32046fc49d6a738be7f34890aa7f012e9823 Mon Sep 17 00:00:00 2001 From: Brian Downs Date: Mon, 14 Dec 2020 16:37:47 -0700 Subject: [PATCH 3/4] quote path in rm call to prevent unnecessary globbing Signed-off-by: Brian Downs --- bundle/bin/rke2-uninstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/bin/rke2-uninstall.sh b/bundle/bin/rke2-uninstall.sh index 58dc212b9d..0b3971a230 100755 --- a/bundle/bin/rke2-uninstall.sh +++ b/bundle/bin/rke2-uninstall.sh @@ -35,7 +35,7 @@ uninstall_disable_services() uninstall_remove_files() { if [ -r /etc/redhat-release ] || [ -r /etc/centos-release ] || [ -r /etc/oracle-release ]; then - yum remove -y rke2-* + yum remove -y "rke2-*" rm -f "/etc/yum.repos.d/rancher-rke2*.repo" fi From 82991427c7875c7c55549c02c87a5080f29b2875 Mon Sep 17 00:00:00 2001 From: Brian Downs Date: Mon, 14 Dec 2020 17:00:18 -0700 Subject: [PATCH 4/4] remove quotes on rm call Signed-off-by: Brian Downs --- bundle/bin/rke2-uninstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/bin/rke2-uninstall.sh b/bundle/bin/rke2-uninstall.sh index 0b3971a230..c1277a5837 100755 --- a/bundle/bin/rke2-uninstall.sh +++ b/bundle/bin/rke2-uninstall.sh @@ -37,7 +37,7 @@ uninstall_remove_files() if [ -r /etc/redhat-release ] || [ -r /etc/centos-release ] || [ -r /etc/oracle-release ]; then yum remove -y "rke2-*" - rm -f "/etc/yum.repos.d/rancher-rke2*.repo" + rm -f /etc/yum.repos.d/rancher-rke2*.repo fi find "${INSTALL_RKE2_ROOT}/lib/systemd/system" -name rke2-*.service -type f -delete