From 9ce0a8102cc5b99eb7211bf60a6f46ce7f3b68e0 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Tue, 1 Sep 2015 15:19:02 +0100 Subject: Fix variable pre-checking in firehose.configure Change-Id: I394d64caa0cc908e1ae7b45ffca9a9a844093d2d --- firehose.configure | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/firehose.configure b/firehose.configure index 9c809f6..cde8b98 100644 --- a/firehose.configure +++ b/firehose.configure @@ -3,6 +3,16 @@ set -e ROOT="$1" +# Check necessary parameters were filled in firehose.morph before +# the system was deployed, and exit if not +if [ -z "$GERRIT_USERNAME" -o \ + -z "$GERRIT_USER" -o \ + -z "$GERRIT_URL" -o \ + -z "$GIT_USERNAME" -o \ + -z "$GIT_EMAIL" ]; then + exit 0 +fi + # Add firehose user chroot "$ROOT" adduser "$GERRIT_USER" -s /bin/false -D chroot "$ROOT" sudo -u "$GERRIT_USER" --ssh-keygen -C "$GERRIT_USER@baserock.org" -N "" @@ -33,16 +43,6 @@ chroot "$ROOT" systemctl enable firehose.timer chroot "$ROOT" systemctl start firehose.timer chroot "$ROOT" systemctl enable firehose.service -# Check necessary parameters were filled in firehose.morph before -# the system was deployed, and exit if not -if - [ -z "$GERRIT_USERNAME" -a \ - -z "$GERRIT_URL" -a \ - -z "$GIT_USERNAME" -a \ - -z "$GIT_EMAIL" -a]; then - exit 0 -fi - # Create firehose.conf to store parameters obtained from .morph file cat >>"$ROOT/etc/firehose.conf" <