diff --git a/buildiso.sh b/buildiso.sh index 6c03885..8b1ddfb 100755 --- a/buildiso.sh +++ b/buildiso.sh @@ -15,6 +15,9 @@ fail() { which lb &>/dev/null || fail "This script requires live-build" sudo -n true &>/dev/null || fail "The user running this script must have sudo privileges." +idir=$( dirname $0 ) +pushd ${idir} &>/dev/null + isofilename="pvc-installer_$(date +%Y-%m-%d).iso" deployusername="deploy" @@ -168,3 +171,5 @@ fi echo echo "Build completed. ISO file: ${isofilename}" + +popd &>/dev/null diff --git a/buildpxe.sh b/buildpxe.sh index 3af9aa5..00f88c1 100755 --- a/buildpxe.sh +++ b/buildpxe.sh @@ -11,6 +11,9 @@ test -f /usr/lib/PXELINUX/pxelinux.0 &>/dev/null || fail "This script requires p test -f /usr/lib/syslinux/modules/bios/ldlinux.c32 &>/dev/null || fail "This script requires pxelinux and syslinux-common" sudo -n true &>/dev/null || fail "The user running this script must have sudo privileges." +idir=$( dirname $0 ) +pushd ${idir} &>/dev/null + outputdir="pvc-installer-pxe_$(date +%Y-%m-%d)/" deployusername="deploy" @@ -79,9 +82,8 @@ fail() { } build_iso() { - idir=$( dirname $0 ) if [[ ! -f pvc-installer_pxe-tmp.iso ]]; then - ${idir}/buildiso.sh \ + ./buildiso.sh \ -o pvc-installer_pxe-tmp.iso \ -u ${deployusername} \ ${preserve_artifacts} \ @@ -145,3 +147,5 @@ build_pxe cleanup echo "PVC Live Installer PXE generation complete." + +popd &>/dev/null