summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/infest/prepare.sh
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-01-09 22:04:02 +0100
committerjeschli <jeschli@gmail.com>2018-01-09 22:04:02 +0100
commitf4a23ea078c385fd3f9bfe23f935cd6886d4571d (patch)
tree9a1b9a8ffea58a66dcbbc6636688874d0ce314e8 /krebs/4lib/infest/prepare.sh
parent26c4dfbdfc7c484e49717426ea1516d559a8ac61 (diff)
infest prepare: add _which
Diffstat (limited to 'krebs/4lib/infest/prepare.sh')
-rw-r--r--krebs/4lib/infest/prepare.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/krebs/4lib/infest/prepare.sh b/krebs/4lib/infest/prepare.sh
index 4179d8294..ee5f334c7 100644
--- a/krebs/4lib/infest/prepare.sh
+++ b/krebs/4lib/infest/prepare.sh
@@ -94,11 +94,14 @@ prepare_nixos_iso() {
mkdir -p bin
rm -f bin/nixos-install
- cp "$(type -p nixos-install)" bin/nixos-install
+ cp "$(_which nixos-install)" bin/nixos-install
sed -i "s@NIX_PATH=\"[^\"]*\"@NIX_PATH=$target_path@" bin/nixos-install
}
prepare_hetzner_rescue() {
+ _which() (
+ which "$1"
+ )
mountpoint /mnt
type bzip2 2>/dev/null || apt-get install bzip2
@@ -138,6 +141,9 @@ EOF
}
prepare_common() {(
+ _which() (
+ type -p "$1"
+ )
_prepare_nix_users
@@ -245,7 +251,7 @@ _prepare_nixos_install() {
mkdir -p bin
rm -f bin/nixos-install
- cp "$(type -p nixos-install)" bin/nixos-install
+ cp "$(_which nixos-install)" bin/nixos-install
sed -i "s@NIX_PATH=\"[^\"]*\"@NIX_PATH=$target_path@" bin/nixos-install
if ! grep -q '^PATH.*#krebs' .bashrc; then