Updated variable names from all caps to camel case

This commit is contained in:
2025-11-05 17:53:26 -05:00
parent d80992da00
commit eb74132f81

View File

@@ -8,7 +8,7 @@ BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
cat << EOF cat << EOF
####################################### #######################################
## ## ## ##
## $(cat "${BASEDIR}/title") Script ## ## $(cat "${baseDir}/title") Script ##
## ## ## ##
## Jean <jean@easthighnerd.net> ## ## Jean <jean@easthighnerd.net> ##
## ## ## ##
@@ -25,17 +25,17 @@ EOF
printf \ printf \
'ZOL_FEDORA_VER="2-6"\n' | \ 'zolFedoraVer="2-6"\n' | \
tee \ tee \
"${BASEDIR}/system.conf" \ "${baseDir}/system.conf" \
&> \ &> \
/dev/null /dev/null
printf \ printf \
'(NVMe) SSD or HDD?\n' '(NVMe) SSD or HDD?\n'
select OPTION in 'SSD' 'HDD' select option in 'SSD' 'HDD'
do do
case "${OPTION}" in case "${option}" in
'SSD'|'HDD') 'SSD'|'HDD')
break break
;; ;;
@@ -47,10 +47,10 @@ do
done done
printf \ printf \
"DISK_TYPE=\"${OPTION}\"\n" | \ "diskType=\"${option}\"\n" | \
tee \ tee \
--append \ --append \
"${BASEDIR}/system.conf" \ "${baseDir}/system.conf" \
&> \ &> \
/dev/null /dev/null
@@ -59,9 +59,9 @@ printf \
printf \ printf \
'\nGet disk from:\n' '\nGet disk from:\n'
select OPTION in '/dev/disk/by-id/' '/dev/' select option in '/dev/disk/by-id/' '/dev/'
do do
case "${OPTION}" in case "${option}" in
'/dev/disk/by-id/'|'/dev/') '/dev/disk/by-id/'|'/dev/')
break break
;; ;;
@@ -75,26 +75,26 @@ done
printf \ printf \
'\033[2J\033[H' '\033[2J\033[H'
if [[ "${OPTION}" == '/dev/disk/by-id/' ]]; then if [[ "${option}" == '/dev/disk/by-id/' ]]; then
DRIVES="$(ls -Ago /dev/disk/by-id/ | grep -v 'sr' | grep -v 'dm-' | grep -v 'nvme-eui.' | grep -v '\-part' | grep -v 'wwn-' | grep -v '_[1-9] -> ' | grep -v 'total' | sed 's|^.*\:[0-5][0-9] ||g; s| -> .*$||g' | tr -d '[:blank:]')" drives="$(ls -Ago /dev/disk/by-id/ | grep -v 'sr' | grep -v 'dm-' | grep -v 'nvme-eui.' | grep -v '\-part' | grep -v 'wwn-' | grep -v '_[1-9] -> ' | grep -v 'total' | sed 's|^.*\:[0-5][0-9] ||g; s| -> .*$||g' | tr -d '[:blank:]')"
printf \ printf \
'\nSelect the disk you want to use:\n' '\nSelect the disk you want to use:\n'
DRIVES=( ${DRIVES} ) drives=( ${drives} )
shopt -s extglob shopt -s extglob
MENU="@(${DRIVES[0]}" menu="@(${drives[0]}"
for ((i=1;i<${#DRIVES[@]};i++)); do for ((i=1;i<${#drives[@]};i++)); do
MENU+="|${DRIVES[$i]}" menu+="|${drives[$i]}"
done done
MENU+=")" menu+=")"
select DRIVE in "${DRIVES[@]}" select drive in "${drives[@]}"
do do
case ${DRIVE} in case ${drive} in
${MENU}) ${menu})
break break
;; ;;
*) *)
@@ -105,32 +105,32 @@ if [[ "${OPTION}" == '/dev/disk/by-id/' ]]; then
done done
printf \ printf \
"DISK=\"/dev/disk/by-id/${DRIVE}\"\n" | \ "disk=\"/dev/disk/by-id/${drive}\"\n" | \
tee \ tee \
--append \ --append \
"${BASEDIR}/system.conf" \ "${baseDir}/system.conf" \
&> \ &> \
/dev/null /dev/null
elif [[ "${OPTION}" == '/dev/' ]]; then elif [[ "${option}" == '/dev/' ]]; then
DRIVES="$(lsblk -do name | grep -v 'loop' | grep -v 'sr' | grep -v 'zram' | grep -v 'NAME' | tr -d '[:blank:]')" drives="$(lsblk -do name | grep -v 'loop' | grep -v 'sr' | grep -v 'zram' | grep -v 'NAME' | tr -d '[:blank:]')"
printf \ printf \
'\nSelect the disk you want to use:\n' '\nSelect the disk you want to use:\n'
DRIVES=( ${DRIVES} ) drives=( ${drives} )
shopt -s extglob shopt -s extglob
MENU="@(${DRIVES[0]}" menu="@(${drives[0]}"
for ((i=1;i<${#DRIVES[@]};i++)); do for ((i=1;i<${#drives[@]};i++)); do
MENU+="|${DRIVES[$i]}" menu+="|${drives[$i]}"
done done
MENU+=")" menu+=")"
select DRIVE in "${DRIVES[@]}" select drive in "${drives[@]}"
do do
case ${DRIVE} in case ${drive} in
${MENU}) ${menu})
break break
;; ;;
*) *)
@@ -141,10 +141,10 @@ elif [[ "${OPTION}" == '/dev/' ]]; then
done done
printf \ printf \
"DISK=\"/dev/${DRIVE}\"\n" | \ "disk=\"/dev/${drive}\"\n" | \
tee \ tee \
--append \ --append \
"${BASEDIR}/system.conf" \ "${baseDir}/system.conf" \
&> \ &> \
/dev/null /dev/null
fi fi
@@ -152,52 +152,52 @@ fi
printf \ printf \
'\033[2J\033[H' '\033[2J\033[H'
HOSTNAME='-' hostname='-'
while [[ "${HOSTNAME}" == '-' ]] || [[ -z "${HOSTNAME}" ]] || [[ "${HOSTNAME}" = *' '* ]] || [[ "${HOSTNAME}" = *_* ]]; do while [[ "${hostname}" == '-' ]] || [[ -z "${hostname}" ]] || [[ "${hostname}" = *' '* ]] || [[ "${hostname}" = *_* ]]; do
printf \ printf \
'\nEnter a hostname for this machine (no spaces or underscores):\n' '\nEnter a hostname for this machine (no spaces or underscores):\n'
read \ read \
-r \ -r \
HOSTNAME hostname
if [[ "${HOSTNAME}" = *' '* ]] || [[ "${HOSTNAME}" = *_* ]]; then if [[ "${hostname}" = *' '* ]] || [[ "${hostname}" = *_* ]]; then
printf \ printf \
'ERROR:\tNo spaces or underscores in the hostname!\n' 'ERROR:\tNo spaces or underscores in the hostname!\n'
fi fi
done done
printf \ printf \
"HOSTNAME=\"${HOSTNAME}\"\n" | \ "hostname=\"${hostname}\"\n" | \
tee \ tee \
--append \ --append \
"${BASEDIR}/system.conf" \ "${baseDir}/system.conf" \
&> \ &> \
/dev/null /dev/null
printf \ printf \
'\033[2J\033[H' '\033[2J\033[H'
USERNAME='-' username='-'
while [[ "${USERNAME}" == '-' ]] || [[ -z "${USERNAME}" ]] || [[ "${USERNAME}" = *' '* ]] || [[ "${USERNAME}" = *[A-Z]* ]]; do while [[ "${username}" == '-' ]] || [[ -z "${username}" ]] || [[ "${username}" = *' '* ]] || [[ "${username}" = *[A-Z]* ]]; do
printf \ printf \
'\nEnter a name for the new user account (lowercase, no spaces):\n' '\nEnter a name for the new user account (lowercase, no spaces):\n'
read \ read \
-r \ -r \
USERNAME username
if [[ "${USERNAME}" = *' '* ]] || [[ "${USERNAME}" = *[A-Z]* ]]; then if [[ "${username}" = *' '* ]] || [[ "${username}" = *[A-Z]* ]]; then
printf \ printf \
'ERROR:\tNo spaces or uppercase letters in the username!\n' 'ERROR:\tNo spaces or uppercase letters in the username!\n'
fi fi
done done
printf \ printf \
"USERNAME=\"${USERNAME}\"\n" | \ "username=\"${username}\"\n" | \
tee \ tee \
--append \ --append \
"${BASEDIR}/system.conf" \ "${baseDir}/system.conf" \
&> \ &> \
/dev/null /dev/null
@@ -206,9 +206,9 @@ printf \
printf \ printf \
'\nEnable SWAP?\n' '\nEnable SWAP?\n'
select OPTION in 'yes' 'no' select option in 'yes' 'no'
do do
case "${OPTION}" in case "${option}" in
'yes'|'no') 'yes'|'no')
break break
;; ;;
@@ -220,10 +220,10 @@ do
done done
printf \ printf \
"ENABLE_SWAP=\"${OPTION}\"\n" | \ "enableSwap=\"${option}\"\n" | \
tee \ tee \
--append \ --append \
"${BASEDIR}/system.conf" \ "${baseDir}/system.conf" \
&> \ &> \
/dev/null /dev/null
@@ -232,9 +232,9 @@ printf \
printf \ printf \
'\nEnable encryption?\n' '\nEnable encryption?\n'
select OPTION in 'yes' 'no' select option in 'yes' 'no'
do do
case "${OPTION}" in case "${option}" in
'yes'|'no') 'yes'|'no')
break break
;; ;;
@@ -246,10 +246,10 @@ do
done done
printf \ printf \
"ENCRYPTION=\"${OPTION}\"\n" | \ "encryption=\"${option}\"\n" | \
tee \ tee \
--append \ --append \
"${BASEDIR}/system.conf" \ "${baseDir}/system.conf" \
&> \ &> \
/dev/null /dev/null
@@ -258,7 +258,7 @@ printf \
cat << EOF cat << EOF
Configuration stored in '${BASEDIR}/system.conf' Configuration stored in '${baseDir}/system.conf'
Press any key to return to the main menu Press any key to return to the main menu
EOF EOF