git » kxd » commit 65d281a

scripts: Fix kxd-add-client-key missing "fi" and wrong variable

author Alberto Bertogli
2014-07-13 13:31:23 UTC
committer Alberto Bertogli
2014-07-13 13:31:23 UTC
parent fdc6d8c6be0e91086395e6d8e7f923ae4b36d302

scripts: Fix kxd-add-client-key missing "fi" and wrong variable

Somehow, scripts/kxd-add-client-key is missing a "fi" to close the "if"
statement, and uses $SERVER instead of $CLIENT in a couple of places.

This patch fixes that.

Thanks to Maximiliano Curia for reporting the issue.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

scripts/kxd-add-client-key +3 -2

diff --git a/scripts/kxd-add-client-key b/scripts/kxd-add-client-key
index eff0d56..dbeb958 100755
--- a/scripts/kxd-add-client-key
+++ b/scripts/kxd-add-client-key
@@ -5,7 +5,7 @@ set -e
 CLIENT="$1"
 KEYNAME="$2"
 
-if [ "$SERVER" = "" ] || [ "$KEYNAME" = "" ]; then
+if [ "$CLIENT" = "" ] || [ "$KEYNAME" = "" ]; then
 	echo "
 Usage: kxd-add-client-key <client hostname> <key name>
 
@@ -15,8 +15,9 @@ corresponding configuration (including a randomly generated key) in
 /etc/kxd/data/<client hostname>/<key name>/.
 "
 	exit 1
+fi
 
-CONFIGPATH="/etc/kxd/data/$SERVER/$KEYNAME"
+CONFIGPATH="/etc/kxd/data/$CLIENT/$KEYNAME"
 
 echo "Creating directory ($CONFIGPATH)"
 mkdir -p "$CONFIGPATH"