From 8cb48b200baa5ab1789fd91c150764694ac2c9d6 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Mon, 4 Sep 2023 16:49:28 +1000 Subject: [PATCH] fix check for already installed --- install-koji-farm.sh | 4 ++-- koji-setup/add-koji-builder.sh | 4 ++-- koji-setup/koji-deploy-builder.sh | 4 ++-- koji-setup/koji-deploy-nfs-client.sh | 4 +--- koji-setup/koji-deploy-nfs-server.sh | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/install-koji-farm.sh b/install-koji-farm.sh index 099dd68..dfa8a75 100644 --- a/install-koji-farm.sh +++ b/install-koji-farm.sh @@ -31,10 +31,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 [ ! "dnf list installed | grep epel-release" ] ; then +if [ -z $(dnf list installed | grep epel-release) ] ; then dnf install -y epel-release $QUIET fi -if [ ! "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/add-koji-builder.sh b/koji-setup/add-koji-builder.sh index f1de3bc..8494547 100644 --- a/koji-setup/add-koji-builder.sh +++ b/koji-setup/add-koji-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 [ ! "dnf list installed | grep epel-release" ] ; then +if [ -z $(dnf list installed | grep epel-release) ] ; then dnf install -y epel-release $QUIET fi -if [ ! "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-deploy-builder.sh b/koji-setup/koji-deploy-builder.sh index 32e082f..c9e5ac1 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 [ ! "dnf list installed | grep epel-release" ] ; then +if [ -z $(dnf list installed | grep epel-release) ] ; then dnf install -y epel-release $QUIET fi -if [ ! "dnf list installed | grep koji-builder" ] ; then +if [ -z $(dnf list installed | grep koji-builder) ] ; then dnf install -y koji-builder fi diff --git a/koji-setup/koji-deploy-nfs-client.sh b/koji-setup/koji-deploy-nfs-client.sh index 450d291..9666127 100755 --- a/koji-setup/koji-deploy-nfs-client.sh +++ b/koji-setup/koji-deploy-nfs-client.sh @@ -10,8 +10,6 @@ for param in $1 $2 ; do case $param in debug ) DEBUG="debug" ;; - * ) - KOJI_BUILD_FQDN=$param ;; esac else break @@ -19,7 +17,7 @@ for param in $1 $2 ; do done if [ $DEBUG ] ; then - set -x + set -xe SILENT= QUIET="-v" fi diff --git a/koji-setup/koji-deploy-nfs-server.sh b/koji-setup/koji-deploy-nfs-server.sh index 2755c41..5789125 100755 --- a/koji-setup/koji-deploy-nfs-server.sh +++ b/koji-setup/koji-deploy-nfs-server.sh @@ -17,7 +17,7 @@ for param in $1 $2 ; do done if [ $DEBUG ] ; then - set -x + set -xe SILENT= QUIET="-v" fi