From 57f8fa6a5b08bafdb6a422b6837d9b8cb3f7c396 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 8 Aug 2016 22:38:32 -0700 Subject: [PATCH] fix bug in turning off auto-decrypt --- chboot | 2 +- dsfull | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/chboot b/chboot index 609b41d..884b2a5 100755 --- a/chboot +++ b/chboot @@ -63,6 +63,6 @@ e umount $mount_point e rmdir $mount_point if $reboot; then - systemctl stop keyscriptoff.service + touch /tmp/keyscript-off reboot now fi diff --git a/dsfull b/dsfull index f141bc5..c5cb230 100755 --- a/dsfull +++ b/dsfull @@ -7,6 +7,12 @@ set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR +reboot=true +if [[ $1 == -r ]]; then + reboot=false + shift +fi + host=$1 if [[ ! $host || $host == -h ]]; then @@ -15,14 +21,15 @@ if [[ ! $host || $host == -h ]]; then fi set -x -ssh $host sudo bash <<'EOF' -set -e -systemctl stop keyscriptoff.service +if $reboot; then + ssh $host sudo bash <<'EOF' || [[ $? == 255 ]] +touch /tmp/keyscript-off reboot ||: EOF +fi pxe-server fai $host while ! ssh $host :; do - sleep 5 + sleep 5 done dsremote $host -- 2.30.2