Updated variable names and casing
This commit is contained in:
16
list.sh
16
list.sh
@@ -2,18 +2,18 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
|
baseDir="$(realpath "$(dirname "${0}")")"
|
||||||
|
|
||||||
|
|
||||||
DISKS_BY_ID="$(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 -e 's|^.*\:[0-5][0-9] ||g')"
|
disksById="$(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 -e 's|^.*\:[0-5][0-9] ||g')"
|
||||||
DISKS="$(lsblk -do name | grep -v 'loop' | grep -v 'sr' | grep -v 'zram' | grep -v 'NAME')"
|
disks="$(lsblk -do name | grep -v 'loop' | grep -v 'sr' | grep -v 'zram' | grep -v 'NAME')"
|
||||||
NETWORK_INTERFACES="$(ip -br addr show | sed -e 's| .*$||g' | grep -v '^lo' | grep -v 'tailscale' | grep -v '^wg')"
|
networkInterfaces="$(ip -br addr show | sed -e 's| .*$||g' | grep -v '^lo' | grep -v 'tailscale' | grep -v '^wg')"
|
||||||
|
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
#######################################
|
#######################################
|
||||||
## ##
|
## ##
|
||||||
## $(cat "${BASEDIR}/title") Script ##
|
## $(cat "${baseDir}/title") Script ##
|
||||||
## ##
|
## ##
|
||||||
## Jean <jean@easthighnerd.net> ##
|
## Jean <jean@easthighnerd.net> ##
|
||||||
## ##
|
## ##
|
||||||
@@ -34,13 +34,13 @@ EOF
|
|||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
Available disks (/dev/disk/by-id/):
|
Available disks (/dev/disk/by-id/):
|
||||||
${DISKS_BY_ID}
|
${disksById}
|
||||||
|
|
||||||
Available disks (/dev/):
|
Available disks (/dev/):
|
||||||
${DISKS}
|
${disks}
|
||||||
|
|
||||||
Available network interfaces:
|
Available network interfaces:
|
||||||
${NETWORK_INTERFACES}
|
${networkInterfaces}
|
||||||
|
|
||||||
|
|
||||||
Press any key to return to the main menu
|
Press any key to return to the main menu
|
||||||
|
|||||||
40
menu.sh
40
menu.sh
@@ -2,17 +2,17 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
||||||
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
|
baseDir="$(realpath "$(dirname "${0}")")"
|
||||||
OPTION='start'
|
option='start'
|
||||||
|
|
||||||
|
|
||||||
while [[ ! "${OPTION}" == 'Exit' ]]; do
|
while [[ ! "${option}" == 'Exit' ]]; do
|
||||||
printf '\033[?47h\033[2J\033[H'
|
printf '\033[?47h\033[2J\033[H'
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
#######################################
|
#######################################
|
||||||
## ##
|
## ##
|
||||||
## $(cat "${BASEDIR}/title") Script ##
|
## $(cat "${baseDir}/title") Script ##
|
||||||
## ##
|
## ##
|
||||||
## Jean <jean@easthighnerd.net> ##
|
## Jean <jean@easthighnerd.net> ##
|
||||||
## ##
|
## ##
|
||||||
@@ -26,9 +26,9 @@ while [[ ! "${OPTION}" == 'Exit' ]]; do
|
|||||||
#################
|
#################
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
select OPTION in 'List' 'Configure' 'Pre Install' 'Install' 'WiFi Setup' 'Post Install' 'Finalize' 'Exit'
|
select option in 'List' 'Configure' 'Pre Install' 'Install' 'WiFi Setup' 'Post Install' 'Finalize' 'Exit'
|
||||||
do
|
do
|
||||||
case "${OPTION}" in
|
case "${option}" in
|
||||||
'List'|'Configure'|'Pre Install'|'Install'|'WiFi Setup'|'Post Install'|'Finalize'|'Exit')
|
'List'|'Configure'|'Pre Install'|'Install'|'WiFi Setup'|'Post Install'|'Finalize'|'Exit')
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
@@ -40,20 +40,20 @@ EOF
|
|||||||
|
|
||||||
printf '\033[2J\033[H'
|
printf '\033[2J\033[H'
|
||||||
|
|
||||||
if [[ "${OPTION}" == 'List' ]]; then
|
if [[ "${option}" == 'List' ]]; then
|
||||||
"${BASEDIR}/list.sh"
|
"${baseDir}/list.sh"
|
||||||
elif [[ "${OPTION}" == 'Configure' ]]; then
|
elif [[ "${option}" == 'Configure' ]]; then
|
||||||
"${BASEDIR}/configure.sh"
|
"${baseDir}/configure.sh"
|
||||||
elif [[ "${OPTION}" == 'Pre Install' ]]; then
|
elif [[ "${option}" == 'Pre Install' ]]; then
|
||||||
"${BASEDIR}/pre-inst.sh"
|
"${baseDir}/pre-inst.sh"
|
||||||
elif [[ "${OPTION}" == 'Install' ]]; then
|
elif [[ "${option}" == 'Install' ]]; then
|
||||||
"${BASEDIR}/install.sh"
|
"${baseDir}/install.sh"
|
||||||
elif [[ "${OPTION}" == 'WiFi Setup' ]]; then
|
elif [[ "${option}" == 'WiFi Setup' ]]; then
|
||||||
"${BASEDIR}/wifi.sh"
|
"${baseDir}/wifi.sh"
|
||||||
elif [[ "${OPTION}" == 'Post Install' ]]; then
|
elif [[ "${option}" == 'Post Install' ]]; then
|
||||||
"${BASEDIR}/post-inst.sh"
|
"${baseDir}/post-inst.sh"
|
||||||
elif [[ "${OPTION}" == 'Finalize' ]]; then
|
elif [[ "${option}" == 'Finalize' ]]; then
|
||||||
"${BASEDIR}/finalize.sh"
|
"${baseDir}/finalize.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '\033[?47h\033[2J\033[H'
|
printf '\033[?47h\033[2J\033[H'
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
|
baseDir="$(realpath "$(dirname "${0}")")"
|
||||||
|
|
||||||
source \
|
source \
|
||||||
/etc/os-release
|
/etc/os-release
|
||||||
source \
|
source \
|
||||||
"${BASEDIR}/system.conf"
|
"${baseDir}/system.conf"
|
||||||
|
|
||||||
|
|
||||||
if [[ "${1}" == '--disk' ]]; then
|
if [[ "${1}" == '--disk' ]]; then
|
||||||
|
|||||||
6
wifi.sh
6
wifi.sh
@@ -7,13 +7,13 @@ set -euo pipefail
|
|||||||
# resolvectl status | grep 'Link' | sed -e 's|^.*(||g; s|).*||g' | while read -r INTERFACE; do resolvectl dns ${INTERFACE} 9.9.9.9; done && sleep 3 && nmcli device status | grep -v 'DEVICE' | grep -v 'lo' | sed -e 's| .*||g' | while read -r INTERFACE; do nmcli device disconnect ${INTERFACE}; sleep 1; nmcli device connect ${INTERFACE}; done
|
# resolvectl status | grep 'Link' | sed -e 's|^.*(||g; s|).*||g' | while read -r INTERFACE; do resolvectl dns ${INTERFACE} 9.9.9.9; done && sleep 3 && nmcli device status | grep -v 'DEVICE' | grep -v 'lo' | sed -e 's| .*||g' | while read -r INTERFACE; do nmcli device disconnect ${INTERFACE}; sleep 1; nmcli device connect ${INTERFACE}; done
|
||||||
|
|
||||||
|
|
||||||
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
|
baseDir="$(realpath "$(dirname "${0}")")"
|
||||||
|
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
#######################################
|
#######################################
|
||||||
## ##
|
## ##
|
||||||
## $(cat "${BASEDIR}/title") Script ##
|
## $(cat "${baseDir}/title") Script ##
|
||||||
## ##
|
## ##
|
||||||
## Jean <jean@easthighnerd.net> ##
|
## Jean <jean@easthighnerd.net> ##
|
||||||
## ##
|
## ##
|
||||||
@@ -37,7 +37,7 @@ nmcli device wifi list
|
|||||||
printf "Enter the SSID of the WiFi network you wish to connect to:\n"
|
printf "Enter the SSID of the WiFi network you wish to connect to:\n"
|
||||||
read -r WIFI_NAME
|
read -r WIFI_NAME
|
||||||
|
|
||||||
nmcli --ask device wifi connect ${WIFI_NAME}
|
nmcli --ask device wifi connect ${wifiName}
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user