--backtitle "$(gettext "Press 'Enter' for \"yes\" or 'Escape' for \"no\".")" --yesno "$*" -1 -1 --stdout
return$?
}
# Array of command line arguments
declare -A command=(
[h]="This help screen."
)
# Convert the keys of the associative array to a format usable by getopts
args="${!command[*]}"
args="${args//[[:space:]]/}"
whilegetopts"${args}" i ;do
case"$i" in
h)help;;
*)
exit1
;;
esac
done
# make sure variables are set, or use defaults.
# Make sure this script is ran as root.
if["$(whoami)" !="root"];then
echo"Error: This script must be run as root."
exit1
fi
answer="$(yesno "Have you created your own disk layout and mounted it at /mnt?")"
if[[$answer -eq 1]];then
msgbox "Stormux can format a drive for you. Keep in mind that all data on the selected drive will be lost, including any other operating system that may be installed. To cancel, press control+c."
fi
language=$(menulist "Select the System Language"\
"en_US.UTF-8""English United States"\
"en_GB.UTF-8""English Great Britain"\
"en_GB.UTF-8""English Great Britain"\
"cs_CZ.UTF-8""Czech Republic"\
)
kernel=$(menulist "Select a kernel"\
"Linux""The latest kernel."\
"linux-lts""The long term support kernel"\
"linux-zen""Optimized for desktops"\
)
userName="$(inputbox "Enter the user name for your new system. User names can contain letters (both upper and lowercase), numbers, and underscores (_).")"
password1=""
password2=" "
while[["${password1}" !="${password2}"]];do
password1="$(inputbox "Enter a password for $userName.")"
password2="$(inputbox "Enter the password for $userName again.")"
if[["${password1}" !="${password2}"]];then
msgbox "Passwords do not match."
fi
done
hostname=$(inputbox "Enter the hostname of your computer, for example, stormux-desktop.")