#!/bin/sh # This script will do an offline install of packages that are included in # RPM_TAR_GZS. Every RPM file in the archives will be installed. RPM_TAR_GZS # must be defined and it needs to be a space delimited list of RPM archives. set -u echo "Installing RPMs from archives: $RPM_TAR_GZS" # Create a temporary directory where all archives in $RPM_TAR_GZS will be # extracted to. mkdir tmp # For each archive in RPM_TAR_GZS extract the contents to ./tmp for ARCHIVE in $RPM_TAR_GZS; do tar xvf "$ARCHIVE" -C tmp/ done # Perform a localinstall of all the RPMs extracted from RPM_TAR_GZS. # # Ignore the shellshock error about quoting the find, because in this case we # don't the string to split. # shellcheck disable=SC2046 yum localinstall --disablerepo=* --nogpgcheck -y $(find ./tmp -name "*.rpm") # Delete the temporary RPM packages. rm -rf tmp