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