aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-11-28 17:31:46 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-11-28 17:31:46 +0100
commit6706de5e60e099a883b03930e955bd518ad442e0 (patch)
treec66e7e967458a7241c4f39326b5b932caaf7a929
parentBetter code (diff)
downloadarch-installer-6706de5e60e099a883b03930e955bd518ad442e0.tar.gz
arch-installer-6706de5e60e099a883b03930e955bd518ad442e0.tar.bz2
arch-installer-6706de5e60e099a883b03930e955bd518ad442e0.tar.xz
arch-installer-6706de5e60e099a883b03930e955bd518ad442e0.tar.zst
arch-installer-6706de5e60e099a883b03930e955bd518ad442e0.zip
Whiptail was a mistake
-rwxr-xr-xjoes-arch-install.sh74
1 files changed, 37 insertions, 37 deletions
diff --git a/joes-arch-install.sh b/joes-arch-install.sh
index 50b5e4d..59ae91d 100755
--- a/joes-arch-install.sh
+++ b/joes-arch-install.sh
@@ -45,7 +45,7 @@ END="\033[0;0m"
#--------------------------------------- SOME FUNCTIONS -------------------------------------------#
#==================================================================================================#
jo_goodbye() {
- whiptail --title "Aborting"\
+ dialog --title "Aborting"\
--infobox "Thank you for using Joe's Arch Linux installer.\nAborting..."\
5 30
sleep 4
@@ -54,22 +54,22 @@ jo_goodbye() {
}
jo_chk_internet() {
- whiptail --infobox "Verifying that you are connected to the Internet, please wait..." 4 40
+ dialog --infobox "Verifying that you are connected to the Internet, please wait..." 4 40
sleep 1
if ! wget -q --spider https://www.archlinux.org/; then
- whiptail --title "ERROR"\
+ dialog --title "ERROR"\
--msgbox "Critical error:\n\nIt seems that you are not connected to the internet,\
therefore Joe's installer is forced to abort.\nPlease connect to the Internet and retry."\
12 30
jo_goodbye
else
- whiptail --msgbox "Success!" 5 12
+ dialog --msgbox "Success!" 5 12
fi
}
jo_get_hstnm() {
while [ $hstnm = "" ]; do
- hstnm=$(whiptail\
+ hstnm=$(dialog\
--nocancel --title "$1"\
--inputbox "Please choose a hostname for this machine.\
\n\nIf you are running on a managed network, \
@@ -77,14 +77,14 @@ please ask your network administrator for an appropriate name."\
12 53\
3>&1 1>&2 2>&3 3>&-)
if [ "$hstnm" = "" ]; then
- whiptail --infobox "Hostname is empty, retrying..." 3 34
+ dialog --infobox "Hostname is empty, retrying..." 3 34
sleep 2
fi
done
}
jo_get_options() {
- sel=$(whiptail --nocancel --title "$1" --checklist "Choose optional system \
+ sel=$(dialog --nocancel --title "$1" --checklist "Choose optional system \
components to install:" 10 50 3 \
linux-lts "LTS Kernel" on \
utils "Utils (zip, vim, git...)" on \
@@ -111,7 +111,7 @@ awk '{print $1"-------("$4")";}' | sed -n "$id"p) " >> blkline
((dn--))
((id++))
done
- sel=$(whiptail --nocancel --title "$1"\
+ sel=$(dialog --nocancel --title "$1"\
--menu "Choose the drive on which Arch Linux should be installed:" 12 55 4\
$(cat blkline)\
3>&1 1>&2 2>&3 3>&-)
@@ -122,17 +122,17 @@ awk '{print $1"-------("$4")";}' | sed -n "$id"p) " >> blkline
jo_get_swap_size() {
gogogo=false
while [ "$gogogo" = false ]; do
- swps=$(whiptail\
+ swps=$(dialog\
--nocancel --title "$1"\
--inputbox "Please enter your swap partition disired size: (__G)"\
7 65\
"4"\
3>&1 1>&2 2>&3 3>&-)
if [ "$swps" = "" ]; then
- whiptail --msgbox "Can't be empty. Retrying..." 5 32
+ dialog --msgbox "Can't be empty. Retrying..." 5 32
gogogo=false
elif ! [[ $swps =~ $numregex ]]; then
- whiptail --msgbox "Illegal value, please enter only numerical values. Retrying..." 6 38
+ dialog --msgbox "Illegal value, please enter only numerical values. Retrying..." 6 38
gogogo=false
else
gogogo=true
@@ -143,17 +143,17 @@ jo_get_swap_size() {
jo_get_root_size() {
gogogo=false
while [ "$gogogo" = false ]; do
- rts=$(whiptail\
+ rts=$(dialog\
--nocancel --title "$1"\
--inputbox "Please enter your root partition disired size: (__G)"\
7 65\
"25"\
3>&1 1>&2 2>&3 3>&-)
if [ "$rts" = "" ]; then
- whiptail --msgbox "Can't be empty. Retrying..." 5 32
+ dialog --msgbox "Can't be empty. Retrying..." 5 32
gogogo=false
elif ! [[ $rts =~ $numregex ]]; then
- whiptail --msgbox "Illegal value, please enter only numerical values. Retrying..." 6 38
+ dialog --msgbox "Illegal value, please enter only numerical values. Retrying..." 6 38
gogogo=false
else
gogogo=true
@@ -177,7 +177,7 @@ jo_get_disk_config() {
drv2="$drv""2"
drv3="$drv""3"
drv4="$drv""4"
- if whiptail --title "Confirm this is correct"\
+ if dialog --title "Confirm this is correct"\
--yesno "\
Drive to use:$drv\n\
\n\
@@ -194,7 +194,7 @@ home partition ($drv4) - All that remains"\
}
jo_warn_wiping() {
- if ! whiptail --title "WARNING"\
+ if ! dialog --title "WARNING"\
--yesno "Warning: disk $drv will be wiped. \
Are you sure you wish to continue?"\
6 45; then
@@ -205,19 +205,19 @@ Are you sure you wish to continue?"\
jo_get_root_config() {
gogogo=false
while [ "$gogogo" = false ]; do
- rtpwd=$(whiptail --title "$1"\
+ rtpwd=$(dialog --title "$1"\
--passwordbox "Enter your desired root password:"\
7 40\
3>&1 1>&2 2>&3 3>&-)
- rtrtpwd=$(whiptail --title "$1"\
+ rtrtpwd=$(dialog --title "$1"\
--passwordbox "Confirm root password:"\
7 40\
3>&1 1>&2 2>&3 3>&-)
if ! [ "$rtrtpwd" = "$rtpwd" ]; then
- whiptail --msgbox "Password mismatch" 5 22
+ dialog --msgbox "Password mismatch" 5 22
gogogo=false
elif [ "$rtpwd" = "" ]; then
- whiptail --msgbox "Password can't be empty" 5 28
+ dialog --msgbox "Password can't be empty" 5 28
gogogo=false
else
gogogo=true
@@ -228,13 +228,13 @@ jo_get_root_config() {
jo_get_usr_config() {
gogogo=false
while [ "$gogogo" = false ]; do
- usr=$(whiptail\
+ usr=$(dialog\
--nocancel --title "$1"\
--inputbox "Enter your desired username:"\
7 40\
3>&1 1>&2 2>&3 3>&-)
if [ "$usr" = "" ]; then
- whiptail --msgbox "Username can't be empty" 5 28
+ dialog --msgbox "Username can't be empty" 5 28
gogogo=false
else
usr=$(echo "$usr" | tr '[:upper:]' '[:lower:]')
@@ -244,30 +244,30 @@ jo_get_usr_config() {
isusr=true
gogogo=false
while [ "$gogogo" = false ]; do
- usrpwd=$(whiptail --title "$1"\
+ usrpwd=$(dialog --title "$1"\
--passwordbox "Enter your desired password for $usr:"\
7 50\
3>&1 1>&2 2>&3 3>&-)
- usrusrpwd=$(whiptail --title "$1"\
+ usrusrpwd=$(dialog --title "$1"\
--passwordbox "Confirm $usr password:"\
7 50\
3>&1 1>&2 2>&3 3>&-)
if ! [ "$usrusrpwd" = "$usrpwd" ]; then
- whiptail --msgbox "Password mismatch" 5 22
+ dialog --msgbox "Password mismatch" 5 22
gogogo=false
elif [ "$usrpwd" = "" ]; then
- whiptail --msgbox "Password can't be empty" 5 28
+ dialog --msgbox "Password can't be empty" 5 28
gogogo=false
else
gogogo=true
fi
done
- if whiptail --title "$1"\
+ if dialog --title "$1"\
--yesno "Should $usr be sudo?"\
6 45; then
isusrsudo=true
fi
- usrshell=$(whiptail --title "$1"\
+ usrshell=$(dialog --title "$1"\
--menu "Choose a shell for $usr:"\
10 40 3\
"zsh" "The z shell"\
@@ -279,9 +279,9 @@ jo_get_usr_config() {
jo_pacstrap() {
paclen=$(echo -n "$1" | wc -c)
diaglen=$(echo "15 + $paclen" | bc)
- whiptail --title "$1" --infobox "Installing $1" 3 "$diaglen"
+ dialog --title "$1" --infobox "Installing $1" 3 "$diaglen"
if pacstrap /mnt/arch "$1" > /dev/null 2>&1; then
- whiptail --title "$1" --infobox "$1 installed" 3 "$diaglen"
+ dialog --title "$1" --infobox "$1 installed" 3 "$diaglen"
sleep 0.5
fi
}
@@ -289,7 +289,7 @@ jo_pacstrap() {
#--------------------------------------------- START ----------------------------------------------#
#==================================================================================================#
clear
-whiptail --title "Welcome" --msgbox "Welcome to Joe's Arch Linux installation utility!" 6 35
+dialog --title "Welcome" --msgbox "Welcome to Joe's Arch Linux installation utility!" 6 35
#==================================================================================================#
#--------------------------------------- INTERNET CHECK -------------------------------------------#
#==================================================================================================#
@@ -311,7 +311,7 @@ jo_warn_wiping
#------------------------------------ USERS AND ROOT SETUP ----------------------------------------#
#==================================================================================================#
jo_get_root_config "III. USERS SETUP"
-if whiptail --title "III. USERS SETUP"\
+if dialog --title "III. USERS SETUP"\
--yesno "Would you like to add a user to the system?"\
6 45; then
jo_get_usr_config "III. USERS SETUP"
@@ -322,7 +322,7 @@ fi
#================================================================#
#--------------------------- NTP DATE ---------------------------#
#================================================================#
-whiptail --title "IV. INSTALLING LINUX"\
+dialog --title "IV. INSTALLING LINUX"\
--infobox "Setting date via ntp"\
3 28
timedatectl set-ntp true > /dev/null 2>&1
@@ -330,7 +330,7 @@ sleep 2
#================================================================#
#------------------------- WIPING DISK --------------------------#
#================================================================#
-whiptail --title "IV. INSTALLING LINUX"\
+dialog --title "IV. INSTALLING LINUX"\
--infobox "Partitioning filesystem"\
3 28
wipefs --all --force "$drv" > /dev/null 2>&1
@@ -386,7 +386,7 @@ p
w
FDISK_BIOS_INPUT
fi
-whiptail --title "IV. INSTALLING LINUX"\
+dialog --title "IV. INSTALLING LINUX"\
--infobox "Making filesystem"\
3 28
if [ "$efimode" = true ]; then
@@ -401,7 +401,7 @@ sleep 2
#================================================================#
#---------------------- MOUNT PARTITIONS ------------------------#
#================================================================#
-whiptail --title "IV. INSTALLING LINUX"\
+dialog --title "IV. INSTALLING LINUX"\
--infobox "Mounting partitions"\
3 28
mkdir /mnt/arch > /dev/null 2>&1
@@ -444,7 +444,7 @@ else
jo_pacstrap linux
jo_pacstrap linux-headers
fi
-whiptail --title "IV. INSTALLING LINUX"\
+dialog --title "IV. INSTALLING LINUX"\
--infobox "Base packages installed"\
4 28
sleep 4