changed and updated diskselection

This commit is contained in:
mfgbhatti 2022-01-24 20:23:23 +00:00
parent 9a11eac27f
commit 8a3799b009
1 changed files with 16 additions and 18 deletions

View File

@ -193,24 +193,22 @@ drivessd () {
esac
}
# selection for disk type
diskpart () {
# show disks present on system
lsblk -n --output TYPE,KNAME,SIZE | awk '$1=="disk"{print NR,"/dev/"$2" - "$3}' # show disks with /dev/ prefix and size
echo -ne "
------------------------------------------------------------------------
THIS WILL FORMAT AND DELETE ALL DATA ON THE DISK
Please make sure you know what you are doing because
after formating your disk there is no way to get data back
------------------------------------------------------------------------
Please enter full path to disk: (example /dev/sda):
"
read -r option
echo "DISK=$option" >> setup.conf
drivessd
set_option DISK "$option"
diskselection () {
# selection for disk type
# show disks present on system
DISKLIST="$(lsblk -n --output TYPE,KNAME,SIZE | awk '$1=="disk"{print "/dev/"$2" - "$3}')" # show disks with /dev/ prefix and size
PS3="$PROMPT"
select _DISK in "${DISKLIST[@]}"; do
if elements_present "$_DISK" "${DISKLIST[@]}"; then
# remove size from string
DISK=$(echo "$_DISK" | awk '{print $1}')
set_option DISK "$DISK"
break
else
invalid_option
break
fi
done
}
userinfo () {