From d022d08ca9779d132c05a283777df03326de3703 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Mon, 4 Sep 2023 20:53:48 +1000 Subject: [PATCH] fix check if already installed --- install-koji-farm.sh | 4 ++-- koji-setup/koji-add-builder.sh | 6 +++--- koji-setup/koji-deploy-builder.sh | 4 ++-- koji-setup/koji-deploy-hub.sh | 4 +++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/install-koji-farm.sh b/install-koji-farm.sh index f1b3a1e..fe42140 100644 --- a/install-koji-farm.sh +++ b/install-koji-farm.sh @@ -32,10 +32,10 @@ curl $SILENT $SCRIPT_GIT/koji-bootstrap-build.sh > $SCRIPT_DIR/koji-bootstrap-bu chmod o+x $SCRIPT_DIR/*.sh # install any required packages -if [ -z $(dnf list installed | grep epel-release) ] ; then +if [[ -z $(dnf list installed | grep epel-release) ]] ; then dnf install -y epel-release $QUIET fi -if [ -z $(dnf list installed | grep netcat) ] ; then +if [[ -z $(dnf list installed | grep netcat) ]] ; then dnf install -y netcat $QUIET fi diff --git a/koji-setup/koji-add-builder.sh b/koji-setup/koji-add-builder.sh index c328382..4b0066d 100644 --- a/koji-setup/koji-add-builder.sh +++ b/koji-setup/koji-add-builder.sh @@ -38,10 +38,10 @@ curl $SILENT $SCRIPT_GIT/koji-deploy-hub.sh > $SCRIPT_DIR/koji-deploy-hub.sh if [ ! -d $SCRIPT_DIR ] ; then mkdir -p $SCRIPT_DIR ; fi # install any required packages -if [ -z $(dnf list installed | grep epel-release) ] ; then +if [[ -z $(dnf list installed | grep epel-release) ]] ; then dnf install -y epel-release $QUIET fi -if [ -z $(dnf list installed | grep netcat) ] ; then +if [[ -z $(dnf list installed | grep netcat) ]] ; then dnf install -y netcat $QUIET fi @@ -79,7 +79,7 @@ else ## On the HUB # check if nfs has been installed on the hub (only need to install once) - if [ -z $(dnf list installed | grep nfs-server) ] ; then + if [[ -z $(dnf list installed | grep nfs-server) ]] ; then # add nfs share for koji files direcory to hub curl $SILENT $SCRIPT_GIT/koji-deploy-nfs-server.sh > $SCRIPT_DIR/koji-deploy-nfs-server.sh chmod o+x $SCRIPT_DIR/koji-deploy-nfs-server.sh diff --git a/koji-setup/koji-deploy-builder.sh b/koji-setup/koji-deploy-builder.sh index 8dd81fb..001d830 100755 --- a/koji-setup/koji-deploy-builder.sh +++ b/koji-setup/koji-deploy-builder.sh @@ -33,10 +33,10 @@ source "$SCRIPT_DIR"/koji-parameters.sh KOJI_BUILD_FQDN="$(hostname -f)" # Install the koji builder componelts from epel -if [ -z $(dnf list installed | grep epel-release) ] ; then +if [[ -z $(dnf list installed | grep epel-release) ]] ; then dnf install -y epel-release $QUIET fi -if [ -z $(dnf list installed | grep koji-builder) ] ; then +if [[ -z $(dnf list installed | grep koji-builder) ]] ; then dnf install -y koji-builder $QUIET fi diff --git a/koji-setup/koji-deploy-hub.sh b/koji-setup/koji-deploy-hub.sh index abc52e0..1c4281c 100644 --- a/koji-setup/koji-deploy-hub.sh +++ b/koji-setup/koji-deploy-hub.sh @@ -38,7 +38,9 @@ fi # Install all the required packages (some live in the epel repo, so we need to install that too) dnf config-manager --set-enabled powertools $QUIET -dnf install -y epel-release $QUIET +if [[ -z $(dnf list installed | grep epel-release) ]] ; then + dnf install -y epel-release $QUIET +fi dnf install -y koji-hub mod_ssl koji koji-web koji-utils policycoreutils-python-utils $QUIET dnf module enable postgresql:10 -y $QUIET dnf install -y postgresql-server $QUIET