install stage 1: Would help to actually tell sed which file to edit

master
BodgeMaster 2023-06-14 10:00:26 +02:00
parent db6c18e67a
commit cdc16c1ad4
1 changed files with 6 additions and 8 deletions

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash
function press_any_key {
echo "Press any key to continue or Ctrl+c to abort."
echo "Press any key to continue or Ctrl+c to abort..."
read -n1 DISCARD_ME
}
function are_you_really_really_sure {
echo "Enter the following to continue: $1"
read DISCARD_ME
read -p "> " DISCARD_ME
if [ "$1" = "$DISCARD_ME" ]; then
return 0
else
@ -18,7 +18,7 @@ function are_you_really_really_sure {
function yesno {
unset DISCARD_ME
while [ -z "$DISCARD_ME" ]; do
read -p "[y/n]" -n1 DISCARD_ME
read -p "[y/n] " -n1 DISCARD_ME
case "$DISCARD_ME" in
y)
return 0
@ -147,8 +147,6 @@ echo "Storage is now prepared and ready for installation.
You need to select a download mirror for Void next.
The script will launch xmirror on the host/live system and determine
the chosen mirror from the config file it generates.
TODO:
"
press_any_key
@ -191,7 +189,7 @@ UUID=$(blkid --output value --match-tag UUID $TARGET_PART_EFI) /boot/efi vfat de
" > /mnt/target/etc/fstab
if grep "#KEYMAP=" /mnt/target/etc/rc.conf; then
sed -i -e 's/#KEYMAP=.*/KEYMAP="'"$KBD_LAYOUT"'"/'
sed -i -e 's/#KEYMAP=.*/KEYMAP="'"$KBD_LAYOUT"'"/' /mnt/target/etc/rc.conf
else
clear
echo "WARNING: Could not locate the keymap setting in rc.conf."
@ -213,7 +211,7 @@ the time zone on-the-fly. If you use Windows, you will want to answer no here.
"
if yesno; then
if grep "#HARDWARECLOCK=" /mnt/target/etc/rc.conf; then
sed -i -e 's/#HARDWARECLOCK=.*/HARDWARECLOCK="UTC"/'
sed -i -e 's/#HARDWARECLOCK=.*/HARDWARECLOCK="UTC"/' /mnt/target/etc/rc.conf
else
clear
echo "WARNING: Could not locate the hardwareclock setting in rc.conf."
@ -226,7 +224,7 @@ if yesno; then
fi
else
if grep "#HARDWARECLOCK=" /mnt/target/etc/rc.conf; then
sed -i -e 's/#HARDWARECLOCK=.*/HARDWARECLOCK="localtime"/'
sed -i -e 's/#HARDWARECLOCK=.*/HARDWARECLOCK="localtime"/' /mnt/target/etc/rc.conf
else
clear
echo "WARNING: Could not locate the hardwareclock setting in rc.conf."