pre-commit: fix shellcheck

This commit is contained in:
Felix Buehler 2023-08-17 23:27:57 +02:00
parent 50bfbb571f
commit 39782072d6
3 changed files with 7 additions and 5 deletions

View file

@ -1,8 +1,8 @@
#!/bin/sh #!/usr/bin/env bash
ask_if_sure(){ ask_if_sure(){
while true; do while true; do
read -p "reinstall & ERASE ALL DATA? [y/n] " yn read -r -p "reinstall & ERASE ALL DATA? [y/n] " yn
case $yn in case $yn in
[Yy]* ) break;; [Yy]* ) break;;
[Nn]* ) exit 1;; [Nn]* ) exit 1;;
@ -36,7 +36,7 @@ blk_info_uuid(){
# #
# If you want to get asked for every password, just remove this function # If you want to get asked for every password, just remove this function
cryptsetup(){ cryptsetup(){
command cryptsetup $* --key-file /tmp/passwd -q command cryptsetup "$@" --key-file /tmp/passwd -q
} }
install_os(){ install_os(){
@ -47,7 +47,7 @@ install_os(){
luks_close(){ luks_close(){
local drive="${1?}" local drive="${1?}"
if cryptsetup status "${drive}" &>/dev/null; then if cryptsetup status "${drive}" > /dev/null 2>&1; then
cryptsetup close "${drive}" cryptsetup close "${drive}"
fi fi
} }

View file

@ -3,6 +3,7 @@
set -eux -o pipefail set -eux -o pipefail
BASE="$(dirname "$(readlink -f "$0")")" BASE="$(dirname "$(readlink -f "$0")")"
# shellcheck source=legacy/helpers.sh
. "${BASE}/helpers.sh" . "${BASE}/helpers.sh"
export HOST=thinkman export HOST=thinkman

View file

@ -3,10 +3,11 @@
set -eux -o pipefail set -eux -o pipefail
BASE="$(dirname "$(readlink -f "$0")")" BASE="$(dirname "$(readlink -f "$0")")"
# shellcheck source=legacy/helpers.sh
. "${BASE}/helpers.sh" . "${BASE}/helpers.sh"
export HOST=serverle export HOST=serverle
export DRIVE_ROOT=/dev/disk/by-id/usb-Seagate_Expansion_2HC015KJ-0\:0 export DRIVE_ROOT="/dev/disk/by-id/usb-Seagate_Expansion_2HC015KJ-0:0"
export NIXOS_FILES="${NIXOS_FILES:-$PWD}" export NIXOS_FILES="${NIXOS_FILES:-$PWD}"
export CHROOT_BASE="/mnt/newroot-${HOST}" export CHROOT_BASE="/mnt/newroot-${HOST}"