progress
This commit is contained in:
parent
a1226ee3e4
commit
4c69decdad
42
functions
42
functions
|
@ -4,7 +4,7 @@ err() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
input() {
|
input_old() {
|
||||||
local input
|
local input
|
||||||
local found="0"
|
local found="0"
|
||||||
echo "$1 $2"
|
echo "$1 $2"
|
||||||
|
@ -41,3 +41,43 @@ reset() {
|
||||||
function packages() { :; }
|
function packages() { :; }
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input() {
|
||||||
|
output=""
|
||||||
|
echo "${1}"
|
||||||
|
read -r -p "[${2}]: " output
|
||||||
|
test -z "${output}" && output="${2}"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
#multiplechoice "networksystem" "dhcpcd" "networkmanager" "iwd" "none"
|
||||||
|
|
||||||
|
multiplechoice() {
|
||||||
|
output=""
|
||||||
|
local done=""
|
||||||
|
local input=("${@}")
|
||||||
|
for i in $(seq 1 "$(( ${#input[@]} - 1 ))"); do
|
||||||
|
if [[ "${i}" == "1" ]]; then
|
||||||
|
choices="${input[$i]}"
|
||||||
|
use="${input[$i]}"
|
||||||
|
else
|
||||||
|
choices="${choices}|${input[$i]}"
|
||||||
|
use+=" ${input[$i]}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
while input "[${choices}]: " "${input[1]}"; do
|
||||||
|
for i in $(seq 1 "$(( ${#input[@]} - 1 ))"); do
|
||||||
|
if [[ "${output}" == "${input[$i]}" ]] || [[ "${output}" == "${input[$i]:0:2}" ]]; then
|
||||||
|
echo setconf add "${1}" "${input[$i]}"
|
||||||
|
done=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ -z "${done}" ]]; then
|
||||||
|
echo wronginput "${output}"
|
||||||
|
echo use these: "${use}"
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
14
main.sh
14
main.sh
|
@ -20,7 +20,7 @@ target_phy_disk() {
|
||||||
local output
|
local output
|
||||||
DISKS_DETAILS=$(lsblk -l -o KNAME,TYPE,SIZE,MODEL,WWN|grep disk)
|
DISKS_DETAILS=$(lsblk -l -o KNAME,TYPE,SIZE,MODEL,WWN|grep disk)
|
||||||
echo "$DISKS_DETAILS"
|
echo "$DISKS_DETAILS"
|
||||||
input "which one?" "$(echo "$DISKS_DETAILS"|awk '{print $1}'|tr '\n' ' ')" "not found."
|
input_old "which one?" "$(echo "$DISKS_DETAILS"|awk '{print $1}'|tr '\n' ' ')" "not found."
|
||||||
TARGET_PHY_DISK="/dev/${output}"
|
TARGET_PHY_DISK="/dev/${output}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ encryption_style() {
|
||||||
echo "c)no keyfile (double pw enter)" #bios: 1 uefi: 2
|
echo "c)no keyfile (double pw enter)" #bios: 1 uefi: 2
|
||||||
echo "d)keyfile on usb" #bios: 1 uefi: ?
|
echo "d)keyfile on usb" #bios: 1 uefi: ?
|
||||||
echo "e)unencrypted boot" #bios: 2 uefi: 2
|
echo "e)unencrypted boot" #bios: 2 uefi: 2
|
||||||
input "how to encrypt?" "a b c d e" "wrong input"
|
multiplechoice "a" "b" "c" "d" "e"
|
||||||
ENCRYPTION_STYLE="$output"
|
ENCRYPTION_STYLE="$output"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ base() {
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx() {
|
gfx() {
|
||||||
input "Which GFX System?" "amd nvidia intel" "unknown error"
|
input_old "Which GFX System?" "amd nvidia intel" "unknown error"
|
||||||
GFX=$output
|
GFX=$output
|
||||||
. ./etc/gfx/$GFX
|
. ./etc/gfx/$GFX
|
||||||
packages
|
packages
|
||||||
|
@ -170,7 +170,7 @@ gfx() {
|
||||||
}
|
}
|
||||||
|
|
||||||
soundsystem() {
|
soundsystem() {
|
||||||
input "Which Soundsystem" "pulseaudio pipewire" "unknown error"
|
input_old "Which Soundsystem" "pulseaudio pipewire" "unknown error"
|
||||||
SOUNDSYSTEM=$output
|
SOUNDSYSTEM=$output
|
||||||
. ./etc/soundsystem/$SOUNDSYSTEM
|
. ./etc/soundsystem/$SOUNDSYSTEM
|
||||||
packages
|
packages
|
||||||
|
@ -178,7 +178,7 @@ soundsystem() {
|
||||||
}
|
}
|
||||||
|
|
||||||
de() {
|
de() {
|
||||||
input "Which Desktop Environment?" "plasma gnome minimal" "unknown error"
|
input_old "Which Desktop Environment?" "plasma gnome minimal" "unknown error"
|
||||||
DE=$output
|
DE=$output
|
||||||
if ! [ "$DE" == "minimal" ]; then
|
if ! [ "$DE" == "minimal" ]; then
|
||||||
gfx
|
gfx
|
||||||
|
@ -190,14 +190,14 @@ de() {
|
||||||
}
|
}
|
||||||
|
|
||||||
printing() {
|
printing() {
|
||||||
input "Do you want printing?" "yes no" "unknown error"
|
input_old "Do you want printing?" "yes no" "unknown error"
|
||||||
if [ "$output" == "yes" ]; then
|
if [ "$output" == "yes" ]; then
|
||||||
addpkg cups
|
addpkg cups
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
lang() {
|
lang() {
|
||||||
input "Which language?" "de en" "unknown error"
|
input_old "Which language?" "de en" "unknown error"
|
||||||
LANGUAGE=$output
|
LANGUAGE=$output
|
||||||
if [ "$LANGUAGE" == "de" ]; then
|
if [ "$LANGUAGE" == "de" ]; then
|
||||||
L1=de_DE
|
L1=de_DE
|
||||||
|
|
Loading…
Reference in New Issue
Block a user