Compare commits

5 Commits

8 changed files with 42 additions and 35 deletions

View File

@@ -50,6 +50,7 @@ network-manager \
openssh-{client,server} \
popularity-contest \
printer-driver-all \
rsync \
systemd-timesyncd \
tasksel \
zfs-initramfs \

2
efi.sh
View File

@@ -2,7 +2,7 @@
set -euo pipefail
baseDir="$(realpath "$(basename "${0}")")"
baseDir="$(realpath "$(dirname "${0}")")"
source \

View File

@@ -2,7 +2,7 @@
set -euo pipefail
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
baseDir="$(realpath "$(dirname "${0}")")"
printf '\033[?47l\012'

View File

@@ -2,6 +2,12 @@
set -euo pipefail
baseDir="$(realpath "$(dirname "${0}")")"
source \
"${baseDir}/system.conf"
printf \
"${hostname}\n" | tee /mnt/etc/hostname &> /dev/null

16
list.sh
View File

@@ -2,18 +2,18 @@
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')"
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')"
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')"
networkInterfaces="$(ip -br addr show | sed -e 's| .*$||g' | grep -v '^lo' | grep -v 'tailscale' | grep -v '^wg')"
cat << EOF
#######################################
## ##
## $(cat "${BASEDIR}/title") Script ##
## $(cat "${baseDir}/title") Script ##
## ##
## Jean <jean@easthighnerd.net> ##
## ##
@@ -34,13 +34,13 @@ EOF
cat << EOF
Available disks (/dev/disk/by-id/):
${DISKS_BY_ID}
${disksById}
Available disks (/dev/):
${DISKS}
${disks}
Available network interfaces:
${NETWORK_INTERFACES}
${networkInterfaces}
Press any key to return to the main menu

40
menu.sh
View File

@@ -2,17 +2,17 @@
set -euo pipefail
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
OPTION='start'
baseDir="$(realpath "$(dirname "${0}")")"
option='start'
while [[ ! "${OPTION}" == 'Exit' ]]; do
while [[ ! "${option}" == 'Exit' ]]; do
printf '\033[?47h\033[2J\033[H'
cat << EOF
#######################################
## ##
## $(cat "${BASEDIR}/title") Script ##
## $(cat "${baseDir}/title") Script ##
## ##
## Jean <jean@easthighnerd.net> ##
## ##
@@ -26,9 +26,9 @@ while [[ ! "${OPTION}" == 'Exit' ]]; do
#################
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
case "${OPTION}" in
case "${option}" in
'List'|'Configure'|'Pre Install'|'Install'|'WiFi Setup'|'Post Install'|'Finalize'|'Exit')
break
;;
@@ -40,20 +40,20 @@ EOF
printf '\033[2J\033[H'
if [[ "${OPTION}" == 'List' ]]; then
"${BASEDIR}/list.sh"
elif [[ "${OPTION}" == 'Configure' ]]; then
"${BASEDIR}/configure.sh"
elif [[ "${OPTION}" == 'Pre Install' ]]; then
"${BASEDIR}/pre-inst.sh"
elif [[ "${OPTION}" == 'Install' ]]; then
"${BASEDIR}/install.sh"
elif [[ "${OPTION}" == 'WiFi Setup' ]]; then
"${BASEDIR}/wifi.sh"
elif [[ "${OPTION}" == 'Post Install' ]]; then
"${BASEDIR}/post-inst.sh"
elif [[ "${OPTION}" == 'Finalize' ]]; then
"${BASEDIR}/finalize.sh"
if [[ "${option}" == 'List' ]]; then
"${baseDir}/list.sh"
elif [[ "${option}" == 'Configure' ]]; then
"${baseDir}/configure.sh"
elif [[ "${option}" == 'Pre Install' ]]; then
"${baseDir}/pre-inst.sh"
elif [[ "${option}" == 'Install' ]]; then
"${baseDir}/install.sh"
elif [[ "${option}" == 'WiFi Setup' ]]; then
"${baseDir}/wifi.sh"
elif [[ "${option}" == 'Post Install' ]]; then
"${baseDir}/post-inst.sh"
elif [[ "${option}" == 'Finalize' ]]; then
"${baseDir}/finalize.sh"
fi
printf '\033[?47h\033[2J\033[H'

View File

@@ -1,12 +1,12 @@
#!/bin/bash
set -euo pipefail
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
baseDir="$(realpath "$(dirname "${0}")")"
source \
/etc/os-release
source \
"${BASEDIR}/system.conf"
"${baseDir}/system.conf"
if [[ "${1}" == '--disk' ]]; then

View File

@@ -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
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
baseDir="$(realpath "$(dirname "${0}")")"
cat << EOF
#######################################
## ##
## $(cat "${BASEDIR}/title") Script ##
## $(cat "${baseDir}/title") Script ##
## ##
## 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"
read -r WIFI_NAME
nmcli --ask device wifi connect ${WIFI_NAME}
nmcli --ask device wifi connect ${wifiName}
cat << EOF