TT#35967 Run deployment.sh with errexit

Add option -e to deplayment.sh to catch the installation's errors.
Run deployment.sh as a script not via external interpreter
'bash <name>'.

Change-Id: I320b535f41f08937c4924c603f8e1a17b23e80e8
changes/47/20947/2
Mykola Malkov 8 years ago
parent ae4e88fca7
commit e7501de456

@ -2,6 +2,8 @@
# Purpose: automatically install Debian + sip:provider platform
################################################################################
set -e
INSTALL_LOG='/tmp/deployment-installer-debug.log'
exec > >(tee -a $INSTALL_LOG )
exec 2> >(tee -a $INSTALL_LOG >&2)
@ -1141,7 +1143,7 @@ clear_partition_table() {
existing_pvs=$(pvs "$disk" -o vg_name --noheadings 2>/dev/null || true)
if [ -n "$existing_pvs" ] ; then
for pv in $existing_pvs ; do
logit "Getting rid of existing VG $pv on partition $part"
logit "Getting rid of existing VG $pv"
vgremove -ff "$pv"
done
fi

@ -128,7 +128,7 @@ deploy() {
einfo "Running ${YELLOW}${version}${NORMAL} of deployment.sh..."; eend 0
RC=0
TARGET_DISK="$TARGET_DISK" /bin/bash "${scripts_dir}/deployment.sh" || RC=$?
TARGET_DISK="$TARGET_DISK" "${scripts_dir}/deployment.sh" || RC=$?
if [ $RC -eq 0 ] ; then
if dialog --yes-label Reboot --no-label Exit --yesno "Successfully finished deployment, enjoy your sip:provider system. Reboot system now?" 0 0 ; then
reboot

Loading…
Cancel
Save