Add new opton to install_pxe.sh script
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adrien Reslinger 2021-10-05 22:38:03 +02:00
parent 9855d8973a
commit fd45cae3f0
Signed by: adrien
GPG key ID: DA7B27055C66D6DE

View file

@ -1,12 +1,15 @@
#/bin/bash #!/usr/bin/env bash
for PARAM in "$@"; do for PARAM in "$@"; do
case "$PARAM" in case "$PARAM" in
--version=*) DIST_VERSION="${PARAM/*=}" ;; --version=*) DIST_VERSION="${PARAM/*=}" ;;
--distrib=*) DISTRIB="${PARAM/*=}" ;; --distrib=*) DISTRIB="${PARAM/*=}" ;;
--static) STATIC=true ;; --static) STATIC=true ;;
--nouefi) UEFI=false ;;
--nocrypt) HDDCRYPT=false ;;
--desktop) DESKTOP=desktop ;;
--help) --help)
echo "syntaxe: $0 [--help] [--static] [--version=7|8] [--distrib=RedHat|CentOS|AlmaLinux]" echo "syntaxe: $0 [--help] [--static] [--version=7|8] [--distrib=RedHat|CentOS|AlmaLinux] [--nouefi] [--nocrypt] [--desktop]"
exit 0 exit 0
;; ;;
esac esac
@ -54,9 +57,19 @@ else
echo "Version ${DIST_VERSION} non reconnue" >&2 echo "Version ${DIST_VERSION} non reconnue" >&2
exit 1 exit 1
fi fi
#DESKTOP=desktop INST_OPTIONS="inst.lang=fr_FR inst.keymap=fr-latin9 panic=1 ks.sendsn ks.sendmac inst.sshd=1 net.ifnames=0 biosdevname=0"
INST_OPTIONS="inst.lang=fr_FR inst.keymap=fr-latin9 panic=1 ks.sendsn ks.sendmac inst.sshd=1 net.ifnames=0 biosdevname=0 $DESKTOP"
INST_OPTIONS="${INST_OPTIONS} inst.vnc inst.vncpassword=SDFGHJKL" INST_OPTIONS="${INST_OPTIONS} inst.vnc inst.vncpassword=SDFGHJKL"
if [ ! -z "$DESKTOP" ]; then
INST_OPTIONS="${INST_OPTIONS} $DESKTOP"
fi
if [ ! -z "$UEFI" ]; then
INST_OPTIONS="${INST_OPTIONS} nouefi"
fi
if [ ! -z "$HDDCRYPT" ]; then
if [ "$HDDCRYPT" == "false" ]; then
INST_OPTIONS="${INST_OPTIONS} nocrypt"
fi
fi
if [ -z "$DNS" ]; then if [ -z "$DNS" ]; then
if [ $(whois $IP | grep -ci dedibox) -gt 0 ]; then if [ $(whois $IP | grep -ci dedibox) -gt 0 ]; then
# Dedibox # Dedibox
@ -79,6 +92,9 @@ if [ $(ip link show | grep ^[0-9] | grep -v lo: | wc -l) -ne 1 ]; then
fi fi
if [ ! -z "$STATIC" ]; then if [ ! -z "$STATIC" ]; then
INST_OPTIONS="ip=$IP::$GW:$MASK:$(hostname -s):$IF:off:${DNS/,*} ${INST_OPTIONS}" INST_OPTIONS="ip=$IP::$GW:$MASK:$(hostname -s):$IF:off:${DNS/,*} ${INST_OPTIONS}"
# if [ "$MASK" -eq "255.255.255.255" ]; then
# INST_OPTIONS="rd.route=0.0.0.0/0:${GW} ${INST_OPTIONS}"
# fi
fi fi
if [ -f /boot/grub2/grub.cfg -o $(find /boot/efi/EFI -name grub.cfg | egrep -c '(almalinux|centos|redhat)') -gt 0 ]; then if [ -f /boot/grub2/grub.cfg -o $(find /boot/efi/EFI -name grub.cfg | egrep -c '(almalinux|centos|redhat)') -gt 0 ]; then
if [ $(sed 's/ /\n/g' /proc/cmdline | grep -c console) -gt 1 ]; then if [ $(sed 's/ /\n/g' /proc/cmdline | grep -c console) -gt 1 ]; then