From 3ba47ecd682e7ebf2e427490d260ed9a188406f1 Mon Sep 17 00:00:00 2001 From: "Illuminatus [CCIO]" Date: Wed, 22 May 2024 12:30:48 -0700 Subject: [PATCH 1/3] Replace all references to yum with dnf. --- scripts/cnode-helper-scripts/cncli.sh | 4 ++-- scripts/cnode-helper-scripts/env | 2 +- scripts/cnode-helper-scripts/guild-deploy.sh | 4 ++-- scripts/grest-helper-scripts/setup-grest.sh | 8 ++++---- scripts/jormu-helper-scripts/prtg_nodestats.sh | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/cnode-helper-scripts/cncli.sh b/scripts/cnode-helper-scripts/cncli.sh index 9ce4e0d56..d2ce372b9 100755 --- a/scripts/cnode-helper-scripts/cncli.sh +++ b/scripts/cnode-helper-scripts/cncli.sh @@ -568,8 +568,8 @@ deployMonitoringAgent() { echo -e "Installing socat .." if command -v apt-get >/dev/null; then sudo apt-get -y install socat >/dev/null || err_exit "'sudo apt-get -y install socat' failed!" - elif command -v yum >/dev/null; then - sudo yum -y install socat >/dev/null || err_exit "'sudo yum -y install socat' failed!" + elif command -v dnf >/dev/null; then + sudo dnf -y install socat >/dev/null || err_exit "'sudo dnf -y install socat' failed!" else err_exit "'socat' not found in \$PATH, needed to for node exporter monitoring!" fi diff --git a/scripts/cnode-helper-scripts/env b/scripts/cnode-helper-scripts/env index 1079b15b4..dbbbbbd16 100644 --- a/scripts/cnode-helper-scripts/env +++ b/scripts/cnode-helper-scripts/env @@ -253,7 +253,7 @@ checkUserVariables() { # : $1 = executable to validate cmdAvailable() { if ! command -v "$1" &>/dev/null; then - printf "${FG_RED}ERROR${NC}: need '$1' (command not found)\nplease install with your packet manager of choice(apt/yum etc..) and relaunch CNTools\nhttps://command-not-found.com/$1" 1>&2 + printf "${FG_RED}ERROR${NC}: need '$1' (command not found)\nplease install with your packet manager of choice(apt/dnf etc..) and relaunch CNTools\nhttps://command-not-found.com/$1" 1>&2 return 1 fi return 0 diff --git a/scripts/cnode-helper-scripts/guild-deploy.sh b/scripts/cnode-helper-scripts/guild-deploy.sh index 4e0b8a60f..54a942b50 100755 --- a/scripts/cnode-helper-scripts/guild-deploy.sh +++ b/scripts/cnode-helper-scripts/guild-deploy.sh @@ -193,7 +193,7 @@ updateWithCustomConfig() { add_epel_repository() { if [[ "${1}" =~ Fedora ]]; then return; fi echo -e "\n Enabling epel repository..." - ! grep -q ^epel <<< "$(yum repolist)" && $sudo yum ${3} install https://dl.fedoraproject.org/pub/epel/epel-release-latest-"${2}".noarch.rpm > /dev/null + ! grep -q ^epel <<< "$(dnf repolist)" && $sudo dnf ${3} install https://dl.fedoraproject.org/pub/epel/epel-release-latest-"${2}".noarch.rpm > /dev/null } # OS Dependencies @@ -209,7 +209,7 @@ os_dependencies() { pkg_list="python3 pkg-config libssl-dev ${libncurses_pkg} libtinfo-dev systemd libsystemd-dev libsodium-dev tmux git jq libtool bc gnupg aptitude libtool secure-delete iproute2 tcptraceroute sqlite3 bsdmainutils libusb-1.0-0-dev libudev-dev unzip llvm clang libnuma-dev libpq-dev build-essential libffi-dev libgmp-dev zlib1g-dev make g++ autoconf automake liblmdb-dev procps xxd" elif [[ "${OS_ID}" =~ rhel ]] || [[ "${OS_ID}" =~ fedora ]] || [[ "${DISTRO}" =~ Fedora ]]; then #CentOS/RHEL/Fedora/RockyLinux - pkgmgrcmd="yum" + pkgmgrcmd="dnf" pkg_list="python3 coreutils ncurses-devel ncurses-libs openssl-devel systemd systemd-devel libsodium-devel tmux git jq gnupg2 libtool iproute bc traceroute sqlite util-linux xz wget unzip procps-ng llvm clang numactl-devel libffi-devel gmp-devel zlib-devel make gcc-c++ autoconf udev lmdb-devel xxd" if [[ "${VERSION_ID}" == "2" ]] ; then #AmazonLinux2 diff --git a/scripts/grest-helper-scripts/setup-grest.sh b/scripts/grest-helper-scripts/setup-grest.sh index 84780c721..6fdfca888 100755 --- a/scripts/grest-helper-scripts/setup-grest.sh +++ b/scripts/grest-helper-scripts/setup-grest.sh @@ -307,8 +307,8 @@ SGVERSION=v1.1.2 if command -v apt-get >/dev/null; then sudo apt-get -y install libpcre3-dev >/dev/null || err_exit "'sudo apt-get -y install libpcre3-dev' failed!" fi - if command -v yum >/dev/null; then - sudo yum -y install pcre-devel >/dev/null || err_exit "'sudo yum -y install prce-devel' failed!" + if command -v dnf >/dev/null; then + sudo dnf -y install pcre-devel >/dev/null || err_exit "'sudo dnf -y install prce-devel' failed!" fi cd haproxy-${major_v}.${minor_v} || return make clean >/dev/null @@ -327,8 +327,8 @@ SGVERSION=v1.1.2 printf "\nInstalling socat .." if command -v apt-get >/dev/null; then sudo apt-get -y install socat >/dev/null || err_exit "'sudo apt-get -y install socat' failed!" - elif command -v yum >/dev/null; then - sudo yum -y install socat >/dev/null || err_exit "'sudo yum -y install socat' failed!" + elif command -v dnf >/dev/null; then + sudo dnf -y install socat >/dev/null || err_exit "'sudo dnf -y install socat' failed!" else err_exit "'socat' not found in \$PATH, needed to for node exporter monitoring!" fi diff --git a/scripts/jormu-helper-scripts/prtg_nodestats.sh b/scripts/jormu-helper-scripts/prtg_nodestats.sh index 500a1cf82..b4e312a15 100755 --- a/scripts/jormu-helper-scripts/prtg_nodestats.sh +++ b/scripts/jormu-helper-scripts/prtg_nodestats.sh @@ -2,7 +2,7 @@ # Checklist: # - If you're not sure of how to make use of this script and setup yourself to PRTG monitor, check in Private Testnet group. -# - Ensure jq is installed via Package Manager of your OS (eg: sudo yum install jq). +# - Ensure jq is installed via Package Manager of your OS (eg: sudo dnf install jq). # - The comment on the last line "| python -m json.tool" is just present for easy human readability, and needs python to be pre-installed on the system. # - The script uses sudo to execute netstat commands. Replace as necessary on your local system. # - Ensure jcli is in the $PATH and accessible for the user thats running httpd/busybox. From 8a751cc47e78b573c1e6f382ddd6f9f42faa1218 Mon Sep 17 00:00:00 2001 From: RdLrT <3169068+rdlrt@users.noreply.github.com> Date: Thu, 23 May 2024 09:23:39 +1000 Subject: [PATCH 2/3] Replace xxd package name with vim-common-2 https://command-not-found.com/xxd --- scripts/cnode-helper-scripts/guild-deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cnode-helper-scripts/guild-deploy.sh b/scripts/cnode-helper-scripts/guild-deploy.sh index 54a942b50..3eec710b3 100755 --- a/scripts/cnode-helper-scripts/guild-deploy.sh +++ b/scripts/cnode-helper-scripts/guild-deploy.sh @@ -210,7 +210,7 @@ os_dependencies() { elif [[ "${OS_ID}" =~ rhel ]] || [[ "${OS_ID}" =~ fedora ]] || [[ "${DISTRO}" =~ Fedora ]]; then #CentOS/RHEL/Fedora/RockyLinux pkgmgrcmd="dnf" - pkg_list="python3 coreutils ncurses-devel ncurses-libs openssl-devel systemd systemd-devel libsodium-devel tmux git jq gnupg2 libtool iproute bc traceroute sqlite util-linux xz wget unzip procps-ng llvm clang numactl-devel libffi-devel gmp-devel zlib-devel make gcc-c++ autoconf udev lmdb-devel xxd" + pkg_list="python3 coreutils ncurses-devel ncurses-libs openssl-devel systemd systemd-devel libsodium-devel tmux git jq gnupg2 libtool iproute bc traceroute sqlite util-linux xz wget unzip procps-ng llvm clang numactl-devel libffi-devel gmp-devel zlib-devel make gcc-c++ autoconf udev lmdb-devel vim-common-2" if [[ "${VERSION_ID}" == "2" ]] ; then #AmazonLinux2 pkg_list="${pkg_list} libusb ncurses-compat-libs pkgconfig srm" From 01c5100b31913046f97dbc600c6ac129a05a5965 Mon Sep 17 00:00:00 2001 From: RdLrT <3169068+rdlrt@users.noreply.github.com> Date: Thu, 23 May 2024 09:26:41 +1000 Subject: [PATCH 3/3] Update guild-deploy.sh --- scripts/cnode-helper-scripts/guild-deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cnode-helper-scripts/guild-deploy.sh b/scripts/cnode-helper-scripts/guild-deploy.sh index 3eec710b3..bda7c237d 100755 --- a/scripts/cnode-helper-scripts/guild-deploy.sh +++ b/scripts/cnode-helper-scripts/guild-deploy.sh @@ -210,7 +210,7 @@ os_dependencies() { elif [[ "${OS_ID}" =~ rhel ]] || [[ "${OS_ID}" =~ fedora ]] || [[ "${DISTRO}" =~ Fedora ]]; then #CentOS/RHEL/Fedora/RockyLinux pkgmgrcmd="dnf" - pkg_list="python3 coreutils ncurses-devel ncurses-libs openssl-devel systemd systemd-devel libsodium-devel tmux git jq gnupg2 libtool iproute bc traceroute sqlite util-linux xz wget unzip procps-ng llvm clang numactl-devel libffi-devel gmp-devel zlib-devel make gcc-c++ autoconf udev lmdb-devel vim-common-2" + pkg_list="python3 coreutils ncurses-devel ncurses-libs openssl-devel systemd systemd-devel libsodium-devel tmux git jq gnupg2 libtool iproute bc traceroute sqlite util-linux xz wget unzip procps-ng llvm clang numactl-devel libffi-devel gmp-devel zlib-devel make gcc-c++ autoconf udev lmdb-devel vim-common" if [[ "${VERSION_ID}" == "2" ]] ; then #AmazonLinux2 pkg_list="${pkg_list} libusb ncurses-compat-libs pkgconfig srm"