summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install/install-image-existing13
-rwxr-xr-xscripts/install/install-image-new5
2 files changed, 14 insertions, 4 deletions
diff --git a/scripts/install/install-image-existing b/scripts/install/install-image-existing
index 27d19f4d..b05de08e 100755
--- a/scripts/install/install-image-existing
+++ b/scripts/install/install-image-existing
@@ -59,9 +59,18 @@ NEWNAME=$NEWVER
echo -n "What would you like to name this image? [$NEWNAME]: "
read response
if [ -n "$response" ]; then
+ badchars=`echo $response | sed -e 's/[a-zA-Z0-9\.\_+-]//g'`
+ if [ -n "$badchars" ]; then
+ echo "Image name must be composed of a-z, A-Z, 0-9, or one of ._+-"
+ exit 1
+ fi
NEWNAME=$response
fi
+if [ -z "$NEWNAME" ]; then
+ failure_exit 'Invalid image name.'
+fi
+
# Validate image name
if [ "$NEWNAME" = "grub" -o "${NEWNAME:0:7}" = "vmlinuz" -o \
"${NEWNAME:0:6}" = "initrd" -o "${NEWNAME:0:10}" = "System.map" -o \
@@ -70,10 +79,6 @@ if [ "$NEWNAME" = "grub" -o "${NEWNAME:0:7}" = "vmlinuz" -o \
exit 1;
fi
-if [ -z "$NEWNAME" ]; then
- failure_exit 'Invalid image name.'
-fi
-
echo "OK. This image will be named: $NEWNAME"
# this is the default if current install is union
diff --git a/scripts/install/install-image-new b/scripts/install/install-image-new
index 5726fa03..c669da8e 100755
--- a/scripts/install/install-image-new
+++ b/scripts/install/install-image-new
@@ -33,6 +33,11 @@ fi
echo -n "What would you like to name this image? [$image_name]: "
read response
if [ -n "$response" ]; then
+ badchars=`echo $response | sed -e 's/[a-zA-Z0-9\.\_+-]//g'`
+ if [ -n "$badchars" ]; then
+ echo "Image name must be composed of a-z, A-Z, 0-9, or one of ._+-"
+ exit 1
+ fi
image_name=$response
fi