diff --git a/script/config.sh b/script/config.sh index 7af8501..fccb91f 100644 --- a/script/config.sh +++ b/script/config.sh @@ -44,7 +44,7 @@ export ISEFI=0 # No, BIOS fi # is EFI firmaare? # Set partition number based on the firmware type -if [ ${ISEFI} -eq 1 ] ; then +if [ ${ISEFI} -ne 0 ] ; then # EFI firmware export EFIPARTITION=1 export CRYPTPARTITION=2 diff --git a/script/lib/confirmation_common.sh b/script/lib/confirmation_common.sh index a9a8130..b8b25e2 100644 --- a/script/lib/confirmation_common.sh +++ b/script/lib/confirmation_common.sh @@ -6,7 +6,7 @@ function confirmation_common(){ # Consistency check for the OVERWRITEINSTALL and ERASEALL - if [ "${ERASEALL}" -eq 1 ] && [ "${OVERWRITEINSTALL}" -eq 1 ] ; then + if [ "${ERASEALL}" -ne 0 ] && [ "${OVERWRITEINSTALL}" -ne 0 ] ; then cat <<- HEREDOC ***** ERROR : Confliction between ERASEALL and OVERWRITEINSTALL ***** ...ERASEALL = ${ERASEALL} @@ -71,7 +71,7 @@ function confirmation_common(){ fi # if YES # For sure ask to be sure to erase. - if [ "${ERASEALL}" -eq 1 ] ; then + if [ "${ERASEALL}" -ne 0 ] ; then echo "Are you sure you want to erase entire ${DEV}? [Y/N]" read -r YESNO if [ "${YESNO}" != "Y" ] && [ "${YESNO}" != "y" ] ; then diff --git a/script/lib/para_install_msg_common.sh b/script/lib/para_install_msg_common.sh index 56e7167..fe21165 100644 --- a/script/lib/para_install_msg_common.sh +++ b/script/lib/para_install_msg_common.sh @@ -14,7 +14,7 @@ function para_install_msg_common() { HEREDOC # In the EFI system, add this mapping - if [ "${ISEFI}" -eq 1 ] ; then + if [ "${ISEFI}" -ne 0 ] ; then echo "/boot/efi : ${DEV}${EFIPARTITION}" fi @@ -22,7 +22,7 @@ function para_install_msg_common() { echo "/ : /dev/mapper/${VGNAME}-${LVROOTNAME}" # In case of erased storage, add this mapping - if [ "${ERASEALL}" -eq 1 ] ; then + if [ "${ERASEALL}" -ne 0 ] ; then echo "swap : /dev/mapper/${VGNAME}-${LVSWAPNAME}" fi diff --git a/script/lib/pre_install_common.sh b/script/lib/pre_install_common.sh index 98efaaa..bb61fb9 100644 --- a/script/lib/pre_install_common.sh +++ b/script/lib/pre_install_common.sh @@ -7,10 +7,10 @@ function pre_install_common() { # ----- Erase entire disk, create partitions, format them and encrypt the LUKS partition ----- - if [ "${ERASEALL}" -eq 1 ] ; then + if [ "${ERASEALL}" -ne 0 ] ; then # Assign specified space and rest of disk to the EFI and LUKS partition, respectively. - if [ "${ISEFI}" -eq 1 ] ; then + if [ "${ISEFI}" -ne 0 ] ; then # EFI # Zap existing partition table and create new GPT echo "...Initializing \"${DEV}\" with GPT." sgdisk --zap-all "${DEV}" @@ -24,7 +24,7 @@ function pre_install_common() { sgdisk --new="${CRYPTPARTITION}":0:0 --change-name="${CRYPTPARTITION}":"Linux LUKS" --typecode="${CRYPTPARTITION}":8309 "${DEV}" # Then print them sgdisk --print "${DEV}" - else + else # BIOS # Zap existing partition table echo "...Erasing partition table of \"${DEV}\"." dd if=/dev/zero of="${DEV}" bs=512 count=1 @@ -80,7 +80,7 @@ function pre_install_common() { # Create a ROOT Logical Volume on VG. if [ -e /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" ] ; then # exist - if [ "${OVERWRITEINSTALL}" -eq 1 ] ; then # exist and overwrite install + if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then # exist and overwrite install echo "...Logical volume \"${VGNAME}-${LVROOTNAME}\" already exists. OK." else # exist and not overwriteinstall cat <<- HEREDOC @@ -98,7 +98,7 @@ function pre_install_common() { return 1 # with error status fi else # not exsit - if [ "${OVERWRITEINSTALL}" -eq 1 ] ; then + if [ "${OVERWRITEINSTALL}" -ne 0 ] ; then cat <<- HEREDOC ***** ERROR : Logical volume "${VGNAME}-${LVROOTNAME}" doesn't exist while overwrite install. ***** ...Check consistency of your config.txt.