diff --git a/encrypt-device.sh b/encrypt-device.sh index a00d831c..b0829b3b 100755 --- a/encrypt-device.sh +++ b/encrypt-device.sh @@ -34,7 +34,7 @@ validate() { if [[ $? != 0 ]]; then status=1 echo '*** /home/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" fi diff --git a/encrypt-swap.sh b/encrypt-swap.sh index cdecc38b..f71d411c 100755 --- a/encrypt-swap.sh +++ b/encrypt-swap.sh @@ -44,7 +44,7 @@ validate() { if [[ $? != 0 ]]; then status=1 echo '*** /root/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" fi diff --git a/escrow-cert.sh b/escrow-cert.sh index ab270b5f..d3895e53 100755 --- a/escrow-cert.sh +++ b/escrow-cert.sh @@ -35,7 +35,7 @@ validate() { if [[ $? != 0 ]]; then status=1 echo '*** /root/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" fi diff --git a/functions.sh b/functions.sh index 31a4beab..ecfc9c62 100644 --- a/functions.sh +++ b/functions.sh @@ -219,7 +219,7 @@ check_result_file() { if [[ $? != 0 ]]; then status=1 echo '*** /root/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" fi diff --git a/nosave-1.sh b/nosave-1.sh index cfbe44c7..1abe8972 100755 --- a/nosave-1.sh +++ b/nosave-1.sh @@ -50,7 +50,7 @@ validate() { if [[ $? != 0 ]]; then status=1 echo '*** /root/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" else diff --git a/nosave-2.sh b/nosave-2.sh index be83bedd..0ea9f340 100755 --- a/nosave-2.sh +++ b/nosave-2.sh @@ -50,7 +50,7 @@ validate() { if [[ $? != 0 ]]; then status=1 echo '*** /root/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" else diff --git a/nosave-3.sh b/nosave-3.sh index d6c76fdf..db758e5a 100755 --- a/nosave-3.sh +++ b/nosave-3.sh @@ -50,7 +50,7 @@ validate() { if [[ $? != 0 ]]; then status=1 echo '*** /root/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" else diff --git a/proxy-auth.sh b/proxy-auth.sh index 8a17b0c9..ce97e06f 100755 --- a/proxy-auth.sh +++ b/proxy-auth.sh @@ -93,16 +93,8 @@ validate() { fi fi - result=$(cat ${tmpdir}/RESULT) - if [[ $? != 0 ]]; then - echo '*** /root/RESULT does not exist in VM image.' - return 1 - elif [[ "${result}" != SUCCESS* ]]; then - echo "${result}" - return 1 - else - return 0 - fi + check_result_file "${tmpdir}" + return $? } cleanup() { diff --git a/proxy-cmdline.sh b/proxy-cmdline.sh index c00e4704..6a10cd04 100755 --- a/proxy-cmdline.sh +++ b/proxy-cmdline.sh @@ -50,14 +50,6 @@ validate() { check_proxy_settings $tmpdir - result=$(cat ${tmpdir}/RESULT) - if [[ $? != 0 ]]; then - echo '*** /root/RESULT does not exist in VM image.' - return 1 - elif [[ "${result}" != SUCCESS* ]]; then - echo "${result}" - return 1 - else - return 0 - fi + check_result_file "${tmpdir}" + return $? } diff --git a/proxy-kickstart.sh b/proxy-kickstart.sh index db793844..494b7e0b 100755 --- a/proxy-kickstart.sh +++ b/proxy-kickstart.sh @@ -87,16 +87,8 @@ validate() { fi fi - result=$(cat ${tmpdir}/RESULT) - if [[ $? != 0 ]]; then - echo '*** /root/RESULT does not exist in VM image.' - return 1 - elif [[ "${result}" != SUCCESS* ]]; then - echo "${result}" - return 1 - else - return 0 - fi + check_result_file "${tmpdir}" + return $? } cleanup() { diff --git a/raid-1.sh b/raid-1.sh index c4cb0cae..f7f8a6db 100755 --- a/raid-1.sh +++ b/raid-1.sh @@ -42,7 +42,7 @@ validate() { if [[ $? != 0 ]]; then status=1 echo '*** /root/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" fi diff --git a/raid-ddf.sh b/raid-ddf.sh index 9648ce82..6512dc67 100755 --- a/raid-ddf.sh +++ b/raid-ddf.sh @@ -50,7 +50,7 @@ validate() { if [[ $? != 0 ]]; then status=1 echo '*** /root/RESULT does not exist in VM image.' - elif [[ "${result}" != SUCCESS* ]]; then + elif [[ "${result%% *}" != SUCCESS ]]; then status=1 echo "${result}" fi