aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-11-27 15:52:01 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-11-27 15:52:01 +0100
commitf20fb0463b733b429a6f732971ec47a64b569ca2 (patch)
tree7b327f3a48820d0583ee16cff400822d146024aa
parentGet disk ok (diff)
downloadarch-installer-f20fb0463b733b429a6f732971ec47a64b569ca2.tar.gz
arch-installer-f20fb0463b733b429a6f732971ec47a64b569ca2.tar.bz2
arch-installer-f20fb0463b733b429a6f732971ec47a64b569ca2.tar.xz
arch-installer-f20fb0463b733b429a6f732971ec47a64b569ca2.tar.zst
arch-installer-f20fb0463b733b429a6f732971ec47a64b569ca2.zip
Dialoged swap size prompt
-rwxr-xr-xjoes-arch-install.sh54
1 files changed, 25 insertions, 29 deletions
diff --git a/joes-arch-install.sh b/joes-arch-install.sh
index 7e16ef8..1fc748b 100755
--- a/joes-arch-install.sh
+++ b/joes-arch-install.sh
@@ -123,6 +123,29 @@ awk '{print $1"-------("$4")";}' | sed -n "$id"p) " >> blkfile
drv=$(lsblk | grep disk | awk '{print $1}' | sed -n "$sel"p)
}
+jo_get_swap_size() {
+ while [ "$gogogo" = false ]; do
+ swps=$(dialog\
+ --nocancel --title "$1"\
+ --inputbox "Please enter your swap partition disired size: (__G)"\
+ 7 65\
+ 3>&1 1>&2 2>&3 3>&-)
+ if [ "$swps" = "" ]; then
+ dialog --msgbox "Can't be empty. Retrying..." 5 32
+ gogogo=false
+ elif ! [[ $swps =~ $numregex ]]; then
+ dialog --msgbox "Illegal value, please enter only numerical values. Retrying..." 6 38
+ gogogo=false
+ else
+ gogogo=true
+ fi
+ done
+}
+
+jo_get_root_size() {
+
+}
+
jo_get_continue() {
if dialog --yesno "$1" $2 $3; then
answr=true
@@ -164,35 +187,8 @@ while [[ $answr != y && $answr != Y && $answr != yes && $answr != Yes && $answr
swps=""
rts=""
jo_get_disk "II. DISK SETUP"
- echo -e "${BMAGENTA}\
-#========= I. DISK SETUP =========#
-# #
-# Please choose wisely #
-# #
-# 2. swap partion size #
-# #
-#=================================#${END}"
- while [ "$gogogo" = false ]; do
- echo && echo
- echo -e "${BCYAN}\
-Please enter your ${BYELLOW}swap partition ${BCYAN}disired size:
-__G"
- echo -n -e "${BYELLOW}> "
- read -r swps
- if [[ $swps == "" ]]; then
- echo && echo
- echo -e "${BRED}Can't be empty, retrying...${END}"
- gogogo=false
- elif ! [[ $swps =~ $numregex ]]; then
- echo && echo
- echo -e "${BRED}Illegal value, please choose something reasonable. Retrying...${END}"
- gogogo=false
- else
- gogogo=true
- fi
- done
- gogogo=false
- clear
+ jo_get_swap_size "II. DISK SETUP"
+ jo_get_root_size "II. DISK SETUP"
echo -e "${BMAGENTA}\
#========= I. DISK SETUP =========#
# #