Update install_pxe.sh script
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Adrien Reslinger 2021-08-16 00:06:04 +02:00
parent 18fb54315d
commit 7c88af5102
Signed by: adrien
GPG key ID: DA7B27055C66D6DE

View file

@ -6,20 +6,23 @@ for PARAM in "$@"; do
--distrib=*) DISTRIB="${PARAM/*=}" ;; --distrib=*) DISTRIB="${PARAM/*=}" ;;
--static) STATIC=true ;; --static) STATIC=true ;;
--help) --help)
echo "syntaxe: $0 [--help] [--static] [--version=7|8] [--distrib=CentOS|AlmaLinux]" echo "syntaxe: $0 [--help] [--static] [--version=7|8] [--distrib=RedHat|CentOS|AlmaLinux]"
esac esac
done done
if [ -z "${DIST_VERSION}" ]; then if [ -z "${DIST_VERSION}" ]; then
DIST_VERSION=8 DIST_VERSION=8
fi fi
if [ -z "${DISTRIB}" ]; then if [ -z "${DISTRIB}" ]; then
DISTRIB="CentOS" DISTRIB="AlmaLinux"
fi fi
if ! which wget; then if ! which wget; then
yum install -y wget yum install -y wget
fi fi
if ! which ipcalc; then
yum install -y ipcalc
fi
IF="$(ip route show | grep ^default | sed 's/.* dev \([^ ]*\) *.*/\1/' | sort -u)" IF="$(ip route show | grep ^default | sed 's/.* dev \([^ ]*\) *.*/\1/' | sort -u)"
IP="$(ip addr show $IF | grep inet\ | awk '{print $2}' | cut -d/ -f1)" IP="$(ip addr show $IF | grep inet\ | awk '{print $2}' | cut -d/ -f1)"
@ -34,6 +37,10 @@ if [ "${DIST_VERSION}" == "8" ]; then
#MIRROIR=http://lune.saacy.reslinger.net/repos/CentOS8/$ARCH/os #MIRROIR=http://lune.saacy.reslinger.net/repos/CentOS8/$ARCH/os
if [ "$DISTRIB" == "CentOS" ]; then if [ "$DISTRIB" == "CentOS" ]; then
MIRROIR=http://mirror.centos.org/centos/8/BaseOS/$ARCH/os MIRROIR=http://mirror.centos.org/centos/8/BaseOS/$ARCH/os
elif [ "$DISTRIB" == "RedHat" ]; then
MIRROIR=https://boot.reslinger.net/repo/8/rhel
# elif [ "$DISTRIB" == "OracleLinux" ]; then
# MIRROIR=https://xxxx/8/BaseOS/x86_64/os
elif [ "$DISTRIB" == "AlmaLinux" ]; then elif [ "$DISTRIB" == "AlmaLinux" ]; then
MIRROIR=https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os MIRROIR=https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os
fi fi