fix check if already installed

This commit is contained in:
Trevor Batley 2023-09-04 20:53:48 +10:00
parent d5a74ece64
commit d022d08ca9
4 changed files with 10 additions and 8 deletions

View File

@ -32,10 +32,10 @@ curl $SILENT $SCRIPT_GIT/koji-bootstrap-build.sh > $SCRIPT_DIR/koji-bootstrap-bu
chmod o+x $SCRIPT_DIR/*.sh chmod o+x $SCRIPT_DIR/*.sh
# install any required packages # 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 dnf install -y epel-release $QUIET
fi fi
if [ -z $(dnf list installed | grep netcat) ] ; then if [[ -z $(dnf list installed | grep netcat) ]] ; then
dnf install -y netcat $QUIET dnf install -y netcat $QUIET
fi fi

View File

@ -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 if [ ! -d $SCRIPT_DIR ] ; then mkdir -p $SCRIPT_DIR ; fi
# install any required packages # 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 dnf install -y epel-release $QUIET
fi fi
if [ -z $(dnf list installed | grep netcat) ] ; then if [[ -z $(dnf list installed | grep netcat) ]] ; then
dnf install -y netcat $QUIET dnf install -y netcat $QUIET
fi fi
@ -79,7 +79,7 @@ else
## On the HUB ## On the HUB
# check if nfs has been installed on the hub (only need to install once) # 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 # 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 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 chmod o+x $SCRIPT_DIR/koji-deploy-nfs-server.sh

View File

@ -33,10 +33,10 @@ source "$SCRIPT_DIR"/koji-parameters.sh
KOJI_BUILD_FQDN="$(hostname -f)" KOJI_BUILD_FQDN="$(hostname -f)"
# Install the koji builder componelts from epel # 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 dnf install -y epel-release $QUIET
fi 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 dnf install -y koji-builder $QUIET
fi fi

View File

@ -38,7 +38,9 @@ fi
# Install all the required packages (some live in the epel repo, so we need to install that too) # 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 config-manager --set-enabled powertools $QUIET
if [[ -z $(dnf list installed | grep epel-release) ]] ; then
dnf install -y epel-release $QUIET dnf install -y epel-release $QUIET
fi
dnf install -y koji-hub mod_ssl koji koji-web koji-utils policycoreutils-python-utils $QUIET dnf install -y koji-hub mod_ssl koji koji-web koji-utils policycoreutils-python-utils $QUIET
dnf module enable postgresql:10 -y $QUIET dnf module enable postgresql:10 -y $QUIET
dnf install -y postgresql-server $QUIET dnf install -y postgresql-server $QUIET