From 02a090a604b6a36b248629b686994dd0eb8b5e98 Mon Sep 17 00:00:00 2001 From: ene Date: Sun, 19 Feb 2023 23:14:54 +0100 Subject: Fix(bootstrap): Remove useless awk call --- bootstrap/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap/install b/bootstrap/install index 7ec982bc..3cdf578e 100755 --- a/bootstrap/install +++ b/bootstrap/install @@ -101,7 +101,7 @@ case $result in host=""; awk -F "." '/nixosConfiguration/{print $2}' "$(tmp 'curl https://git.sils.li/ene/nixos-config/raw/branch/prime/flake.nix')" | awk '{print $1}' > $hosts; - while ! awk -v host $host '{$0 ~ host}' "$hosts" && [ "$host" != "" ]; do + while ! grep "$host" "$hosts" > /dev/null && [ "$host" == "" ]; do i=1; while read -r ho ; do printf "%4s) %s \n" "$i" "$ho"; @@ -111,7 +111,7 @@ case $result in readp "Enter a option: " host [ $host = "q" ] && exit 1 - if awk -v host $host '{$0 ~ host}' "$hosts" && [ "$host" != "" ]; then + if grep "$host" "$hosts" > /dev/null && [ "$host" != "" ]; then host=$(awk -v i="$host" '{if (NR==i) {print $0}}' "$hosts"); else warning "No host selected. Select a host to continue.\n" -- cgit 1.4.1