From 609e729a5faeb780e235734d09cd371d7d819d9d Mon Sep 17 00:00:00 2001 From: Adrien Reslinger Date: Sat, 18 Jun 2022 01:05:03 +0200 Subject: [PATCH] Update install script --- files/usr/local/sbin/install_pxe.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/files/usr/local/sbin/install_pxe.sh b/files/usr/local/sbin/install_pxe.sh index e9e13f0..9fea114 100755 --- a/files/usr/local/sbin/install_pxe.sh +++ b/files/usr/local/sbin/install_pxe.sh @@ -7,9 +7,10 @@ for PARAM in "$@"; do --static) STATIC=true ;; --nouefi) UEFI=false ;; --nocrypt) HDDCRYPT=false ;; + --noswap) NOSWAP=false ;; --desktop) DESKTOP=desktop ;; --help) - echo "syntaxe: $0 [--help] [--static] [--version=7|8] [--distrib=RedHat|CentOS|AlmaLinux] [--nouefi] [--nocrypt] [--desktop]" + echo "syntaxe: $0 [--help] [--static] [--version=7|8|9] [--distrib=RedHat|CentOS|AlmaLinux|RockyLinux] [--nouefi] [--nocrypt] [--desktop] [--noswap]" exit 0 ;; esac @@ -38,18 +39,18 @@ MAC="$(ip addr show $IF | grep ether\ | awk '{print $2}' | cut -d/ -f2 | tr [A- DNS="$(grep nameserver /etc/resolv.conf | grep -v 127.0.0.1 | awk '{printf $2","}' | sed 's/,$//')" ARCH=$(uname -m | sed 's|i.86|i386|') -if [ "${DIST_VERSION}" == "8" ]; then +if [ "${DIST_VERSION}" == "8" -o "${DIST_VERSION}" == "9" ]; then #MIRROIR=http://lune.saacy.reslinger.net/repos/CentOS8/$ARCH/os if [ "$DISTRIB" == "CentOS" ]; then - MIRROIR=http://mirror.centos.org/centos/8/BaseOS/$ARCH/os + MIRROIR=http://mirror.centos.org/centos/${DIST_VERSION}/BaseOS/$ARCH/os elif [ "$DISTRIB" == "RedHat" ]; then - MIRROIR=https://boot.reslinger.net/repo/8/rhel + MIRROIR=https://boot.reslinger.net/repo/${DIST_VERSION}/rhel # elif [ "$DISTRIB" == "OracleLinux" ]; then -# MIRROIR=https://xxxx/8/BaseOS/$ARCH/os +# MIRROIR=https://xxxx/${DIST_VERSION}/BaseOS/$ARCH/os elif [ "$DISTRIB" == "RockyLinux" ]; then - MIRROIR=https://download.rockylinux.org/pub/rocky/8/BaseOS/$ARCH/os/ + MIRROIR=https://download.rockylinux.org/pub/rocky/${DIST_VERSION}/BaseOS/$ARCH/os/ elif [ "$DISTRIB" == "AlmaLinux" ]; then - MIRROIR=https://repo.almalinux.org/almalinux/8/BaseOS/$ARCH/os + MIRROIR=https://repo.almalinux.org/almalinux/${DIST_VERSION}/BaseOS/$ARCH/os fi elif [ "${DIST_VERSION}" == "7" ]; then #MIRROIR=http://centos.mirrors.ovh.net/ftp.centos.org/7/os/$ARCH @@ -72,6 +73,11 @@ if [ ! -z "$HDDCRYPT" ]; then INST_OPTIONS="${INST_OPTIONS} nocrypt" fi fi +if [ ! -z "$NOSWAP" ]; then + if [ "$NOSWAP" == "false" ]; then + INST_OPTIONS="${INST_OPTIONS} noswap" + fi +fi if [ -z "$DNS" ]; then if [ $(whois $IP | grep -ci dedibox) -gt 0 ]; then # Dedibox