summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-06-17 09:49:09 (GMT)
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-06-17 09:49:24 (GMT)
commit101ba4b9bd01a758559b4ab90cc9eb694cc81e2a (patch)
tree39470a25e392db241bd6f4c41213ea48188484dd
parent5de20e562aee3213e09f569f0976eefc7c1132c5 (diff)
downloadbaserock-chroot-101ba4b9bd01a758559b4ab90cc9eb694cc81e2a.tar.gz
Quote shell variable expanions in previous patch series
-rwxr-xr-xmanage-baserock8
1 files changed, 4 insertions, 4 deletions
diff --git a/manage-baserock b/manage-baserock
index b3a8f52..f7cc328 100755
--- a/manage-baserock
+++ b/manage-baserock
@@ -27,7 +27,7 @@ URL="$3"
check_system_name () {
local system="$1"
local valid_chars='A-Za-z0-9_-.'
- case $system in
+ case "$system" in
*[^${valid_chars}]*)
echo "The specified name '${system}' contains invalid characters."
echo "Valid characters are ${valid_chars}."
@@ -54,7 +54,7 @@ case "${ACTION}" in
exec sudo "$0" "$@"
fi
- check_system_name $SYSTEM
+ check_system_name "$SYSTEM"
if test -d "${BASEROCK_BASE}/${SYSTEM}/baserock"; then
echo "Sorry, $SYSTEM already exists"
@@ -66,14 +66,14 @@ case "${ACTION}" in
exit 1
fi
- mkdir -p ${BASEROCK_BASE}
+ mkdir -p "${BASEROCK_BASE}"
TEMP_BASE=$(mktemp -d --tmpdir="${BASEROCK_BASE}")
cleanup () { rm -rf "${TEMP_BASE}"; }
trap cleanup 0
if test "x${URL}" = "x${URL##http://}" -a "x${URL}" = "x${URL##https://}"; then
- if ! test -e ${URL}; then
+ if ! test -e "${URL}"; then
echo "${URL} is neither a HTTP/HTTPS url nor a path to a local file";
exit 1;
fi