From 24054df6f464bec2f1bb2836455e5b7d10563193 Mon Sep 17 00:00:00 2001 From: Peter Ajamian Date: Thu, 1 Jul 2021 18:55:27 +1200 Subject: [PATCH] Check to make sure that we're not already on RockyLinux. (#64) * Check to make sure that we're not already on RockyLinux. Trying to migrate RockyLinux to RockyLinux can cause serious problems. --- migrate2rocky/migrate2rocky.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migrate2rocky/migrate2rocky.sh b/migrate2rocky/migrate2rocky.sh index cff946a..e23865f 100644 --- a/migrate2rocky/migrate2rocky.sh +++ b/migrate2rocky/migrate2rocky.sh @@ -449,6 +449,14 @@ collect_system_info () { redhat-release-eula ) + # Check to make sure that we don't already have a full or partial + # RockyLinux install. + if [[ $(rpm -qa "${!provides_pkg_map[@]}") ]]; then + exit_message \ +$'Found a full or partial RockyLinux install already in place. Aborting\n' +$'because continuing with the migration could cause further damage to system.' + fi + for pkg in "${!provides_pkg_map[@]}"; do printf '.' prov=${provides_pkg_map[$pkg]}