fastinstall+optimierungen

This commit is contained in:
simono41 2018-07-31 07:16:36 +02:00
parent d0d2d393f8
commit 14c986b417

View file

@ -12,10 +12,40 @@ version="${2}"
hostname="$(cat /etc/hostname)" hostname="$(cat /etc/hostname)"
[[ -z "${version}" ]] && version="${hostname#*-}" [[ -z "${version}" ]] && version="${hostname#*-}"
#fastinstall arch-install fastinstall ${version} ${name} ${Partition} ${device} ${dateisystem} ${swap} ${swapspeicher} ${swapverschluesselung} ${offline} ${autodiskdevice} ${autostart} ${extraparameter}
if [ "${1}" == "fastinstall" ]; then
# while-schleife
while (( "$#" ))
do
echo ${1}
export ${1}="y"
startparameter="${startparameter}${1} "
shift
done
fi
if [ "${1}" == "fastinstallnext" ]; then
# for-schleife
for wort in ${3}
do
echo "$wort"
export ${wort%=*}=${wort#*=}
echo "Parameter ${wort%=*} = ${wort#*=}"
done
fi
if [[ $EUID -ne 0 ]]; then if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2 echo "This script must be run as root" 1>&2
sudo "$0" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" 2>&1 | tee /home/user1/install.log # while-schleife
while (( "$#" ))
do
echo ${1}
export ${1}="y"
startparameter="${startparameter}${1} "
shift
done
sudo "${0}" "${startparameter}" 2>&1 | tee /home/user1/install.log
exit 0 exit 0
fi fi
echo "Logged in as root" echo "Logged in as root"
@ -833,6 +863,38 @@ function abfrage() {
# Lade Deutsches Tastaturlayout # Lade Deutsches Tastaturlayout
loadkeys de loadkeys de
if [ "${1}" == "fastinstallnext" ]; then
[[ -z "${name}" ]] && name=arch-linux
[[ -z "${Partition}" ]] && Partition=bios
[[ -z "${boot}" ]] && boot=grub
[[ -z "${device}" ]] && device=/dev/sda
[[ -z "${dateisystem}" ]] && dateisystem=btrfs
[[ -z "${swapspeicher}" ]] && swapspeicher=8G
[[ -z "${swapverschluesselung}" ]] && swapverschluesselung=n
[[ -z "${autostart}" ]] && autostart=n
if [ "${offline}" != "n" ]
then
install="offline"
else
install="online"
fi
if [ "${device}" == "/dev/nvme0n1" ]; then
m2ssddevice=y
fi
echo "Überspringe die Konfiguration wegen dem fastinstall Parameter!!!"
echo "Sie können die Überprüfung mit skipcheck überspringen!!!"
else
read -p "What's your name?: " name read -p "What's your name?: " name
[[ -z "${name}" ]] && name=arch-linux [[ -z "${name}" ]] && name=arch-linux
@ -980,6 +1042,8 @@ function abfrage() {
echo "Extra-Parameter ${wort}=y" echo "Extra-Parameter ${wort}=y"
done done
fi
# Ausgaben # Ausgaben
# Dateisystem # Dateisystem
@ -990,7 +1054,7 @@ function abfrage() {
fi fi
# #
echo "Surname: ${name}" echo "Username: ${name}"
echo "partition type: ${Partition}" echo "partition type: ${Partition}"
echo "Bootloader: ${boot}" echo "Bootloader: ${boot}"
echo "Drive: ${device}" echo "Drive: ${device}"
@ -1093,27 +1157,38 @@ function abfrage() {
echo "ROOT-Partition = ${device}${rootpartitionnummer}" echo "ROOT-Partition = ${device}${rootpartitionnummer}"
# #
if [ "skipcheck" != "y" ]; then
read -p "Are all the details correct ?: [y/N] " sicherheitsabfrage read -p "Are all the details correct ?: [y/N] " sicherheitsabfrage
if [ "$sicherheitsabfrage" != "y" ] if [ "$sicherheitsabfrage" != "y" ]
then then
echo "ABGEBROCHEN" echo "ABGEBROCHEN"
exit 1 exit 1
fi fi
fi
echo "Operating system is installed !!!" echo "Operating system is installed !!!"
sleep 5 sleep 5
} }
# Begin the Script!!!
# for-schleife
for wort in ${1}
do
echo "$wort"
export ${wort%=*}=${wort#*=}
echo "Parameter ${wort%=*} = ${wort#*=}"
done
if [ "${1}" == "fastinstall" ]; then
gitclone
/opt/${repo}/arch-install fastinstallnext ${version} "${startparameter}"
if [ "${1}" != "n" ] exit 0
elif [ "${phaseone}" != "n" ]
then then
if wget -qO- ipv4.icanhazip.com 1>/dev/null 2>&1; then if wget -qO- ipv4.icanhazip.com 1>/dev/null 2>&1; then
read -p "Should I look at the internet for a new install script and then run it ?: [Y/n] " update read -p "Should I look at the internet for a new install script and then run it ?: [Y/n] " update
@ -1133,7 +1208,7 @@ then
echo "Es kann sein das dass Programm nicht korrekt funktioniert!!!" echo "Es kann sein das dass Programm nicht korrekt funktioniert!!!"
fi fi
gitclone gitclone
/opt/${repo}/arch-install n ${version} /opt/${repo}/arch-install phaseone=n ${version}
exit 0 exit 0
fi fi
fi fi
@ -1300,7 +1375,7 @@ sleep 5
secureumount secureumount
echo "" echo ""
echo "Fertig!!!" echo "Fertig!!!"
read -p "allation completed successfully. Do you want to RESTART the PC ?: [Y/n] " sicherheitsabfrage read -p "Allation completed successfully. Do you want to RESTART the PC ?: [Y/n] " sicherheitsabfrage
if [ "$sicherheitsabfrage" != "n" ] if [ "$sicherheitsabfrage" != "n" ]
then then
echo "restart now" echo "restart now"