From ff225d733b4a2798884158fe456563fc54b3bc0e Mon Sep 17 00:00:00 2001 From: Carter Peel Date: Mon, 3 May 2021 22:33:47 -0400 Subject: [PATCH] Touched up README & fixed all bracket syntax in centos2rocky.sh --- README.md | 28 ++++++++++++++++++++++++---- centos2rocky.sh | 4 ++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f1229ee..4903dcf 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,28 @@ Rocky Tools Various scripts and tools that we find useful, whether we use them or they are made for public consumption. For example, conversion scripts or otherwise. +## [Centos2Rocky] -- Conversion Script + +Running this script will convert an existing CentOS 8 system to Rocky Linux 8. + +##### Usage + +```bash +./centos2rocky.sh -h +├── -h # --> Displays this help +├── -r # --> Converts to Rocky +├── -V # --> Verifies switch +└── -R # --> Reinstalls all packages + +[!! USE WITH CAUTION !!] ``` -. -├── centos2rocky.sh # Converts a CentOS 8.3 system to Rocky Linux 8.3 -└── README.md -``` + +##### Debugging + +The `centos2rocky` script pipes everything shown on `stdout` to `/var/log/centos2rocky.log`. + +If you run in to issues executing this script, please submit an issue [here]([Issues · rocky-linux/rocky-tools · GitHub](https://github.com/rocky-linux/rocky-tools/issues)). + +Make sure to [include the output log](https://pastebin.com/), and remove any sensitive information. (if any) + +Feel free to create a pull request if you think you've got the fix. diff --git a/centos2rocky.sh b/centos2rocky.sh index 527535c..d7d206e 100755 --- a/centos2rocky.sh +++ b/centos2rocky.sh @@ -114,7 +114,7 @@ package_swaps() { rpm -ihv "${release_to_install[@]}" # Distrosync if the above succeeded - if [ $? -eq 0 ]; then + if [[ $? -eq 0 ]]; then echo "Removing dnf cache" rm -rf /var/cache/{yum,dnf} echo "Ensuring repos are enabled before the package swap" @@ -143,7 +143,7 @@ module_check() { ;; esac done - if [ ${#unknown_modules[@]} -gt 0 ]; then + if [[ ${#unknown_modules[@]} -gt 0 ]]; then for x in "${unknown_modules[@]}"; do echo "${x}" done