From 625998fc8a46d6e469b20199bb0354fbd315180c Mon Sep 17 00:00:00 2001 From: Johannes Bauer Date: Tue, 16 Jan 2018 19:01:55 +0100 Subject: [PATCH] Only execute luksrku when an actual server config is present Previously, it was always executed (although it shouldn't have made it into the image if no /etc/luksrku-server.bin were present). --- initramfs/luksrku-script | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/initramfs/luksrku-script b/initramfs/luksrku-script index d04ca3b..da43973 100755 --- a/initramfs/luksrku-script +++ b/initramfs/luksrku-script @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright 2016 Johannes Bauer +# Copyright 2016-2017 Johannes Bauer # Released under GPLv3 PREREQ="lvm2" @@ -21,13 +21,12 @@ case $1 in esac . /scripts/functions -configure_networking -#ETH_DEV="eno1" -#ETH_IP="192.168.1.29" -#ETH_NETMASK="255.255.255.0" -#/bin/ifconfig "$ETH_DEV" up "$ETH_IP" netmask "$ETH_NETMASK" -#/bin/ip route add default dev "$ETH_DEV" +if [ ! -f /etc/luksrku-server.bin ]; then + exit 0 +fi + +configure_networking /sbin/luksrku --server-mode -v -k /etc/luksrku-server.bin exit 0