Commit 8704ee47 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Fix error messages in helper's tasks

parent 91af2694
......@@ -10,7 +10,7 @@ set -e
. /usr/share/snf-image/common.sh
if [ ! -b "$SNF_IMAGE_DEV" ]; then
log_error "Device file:\`$SNF_IMAGE_DEV\' is not a block device"
log_error "Device file:\`${SNF_IMAGE_DEV}' is not a block device"
fi
if [ -z "$SNF_IMAGE_TYPE" ]; then
......
......@@ -9,12 +9,12 @@
set -e
. /usr/share/snf-image/common.sh
if [ -z "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir:\`$SNF_IMAGE_TARGET\' is missing"
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir:\`$SNF_IMAGE_TARGET' is missing"
fi
if [ ! -b "$SNF_IMAGE_DEV"]; then
log_error "Device file:\`$SNF_IMAGE_DEV\' is not a block device"
log_error "Device file:\`$SNF_IMAGE_DEV' is not a block device"
fi
mount $SNF_IMAGE_DEV $SNF_IMAGE_TARGET
......
......@@ -10,8 +10,8 @@
set -e
. /usr/share/snf-image/common.sh
if [ -z "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir is missing"
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
fi
if [ "$SNF_IMAGE_TYPE" != "ntfsdump" ]; then
......
......@@ -9,6 +9,9 @@
set -e
. /usr/share/snf-image/common.sh
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing."
fi
if [ "$SNF_IMAGE_TYPE" != "extdump" ]; then
exit 0
......
......@@ -11,7 +11,7 @@ set -e
. /usr/share/snf-image/common.sh
if [ -z "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir is missing"
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
fi
if [ "$SNF_IMAGE_TYPE" != "ntfsdump" ]; then
......
......@@ -11,7 +11,7 @@ set -e
. /usr/share/snf-image/common.sh
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target directory \`$SNF_IMAGE_TARGET\' is missing"
log_error "Target directory \`$SNF_IMAGE_TARGET' is missing"
fi
# Write a diskpart script to %SystemDrive%\Windows\SnfScripts. Sysprep will
......
......@@ -10,8 +10,8 @@
set -e
. /usr/share/snf-image/common.sh
if [ -z "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir is missing"
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
fi
if [ "$SNF_IMAGE_TYPE" != "extdump" ]; then
......
......@@ -54,8 +54,8 @@ linux_hostname() {
sed -ie "s/^[[:blank:]]*127\.0\.1\.1[[:blank:]].\+$/127.0.1.1\t$hostname/" $target/etc/hosts
}
if [ -z "$SNF_IMAGE_TARGET" -o ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Missing target directory"
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
fi
if [ -z "$SNF_IMAGE_HOSTNAME" ]; then
......@@ -63,9 +63,9 @@ if [ -z "$SNF_IMAGE_HOSTNAME" ]; then
fi
if [ "$SNF_IMAGE_TYPE" = "ntfsdump" ]; then
windows_hostname $SNF_IMAGE_TARGET $SNF_IMAGE_PASSWORD
windows_hostname $SNF_IMAGE_TARGET $SNF_IMAGE_HOSTNAME
elif [ "$SNF_IMAGE_TYPE" = "extdump" ]; then
linux_hostname $SNF_IMAGE_TARGET $SNF_IMAGE_PASSWORD
linux_hostname $SNF_IMAGE_TARGET $SNF_IMAGE_HOSTNAME
fi
echo "done"
......
......@@ -58,8 +58,8 @@ linux_password() {
done
}
if [ -z "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir is missing"
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
fi
if [ -z "$SNF_IMAGE_PASSWORD" ]; then
......
......@@ -10,8 +10,8 @@
set -e
. /usr/share/snf-image/common.sh
if [ -z "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir:\`$SNF_IMAGE_TARGET\' is missing"
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir:\`$SNF_IMAGE_TARGET' is missing"
fi
umount $SNF_IMAGE_TARGET
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment