From c0ad4f79febdf49711bbbe3e5f7ec5e248965ddf Mon Sep 17 00:00:00 2001 From: MatMoul Date: Tue, 4 Sep 2018 00:57:16 +0200 Subject: [PATCH] Confirm swap format --- archfi | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/archfi b/archfi index 0c5ed18..c866d51 100644 --- a/archfi +++ b/archfi @@ -527,13 +527,26 @@ formatbootdevice(){ pressanykey } formatswapdevice(){ + options=() + options+=("swap" "") + sel=$(whiptail --backtitle "$apptitle" --title "$txtformatdevice" --menu "${txtselectpartformat//%1/$1 ($2)}" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + if [ ! "$?" = "0" ]; then + return 1 + fi clear echo "${txtformatingpart//%1/$swapdev} swap" - echo "----------------------------------------------" - echo "mkswap $swapdev" - mkswap $swapdev - echo "" - pressanykey + echo "----------------------------------------------------" + case $sel in + swap) + echo "mkswap $swapdev" + mkswap $swapdev + echo "" + pressanykey + ;; + esac + clear } formatdevice(){ options=()