Move into script dirs before running

This commit is contained in:
Joshua Boniface 2023-09-01 15:41:59 -04:00
parent 982614e3c1
commit 17f6cb51d1
2 changed files with 11 additions and 2 deletions

View File

@ -15,6 +15,9 @@ fail() {
which lb &>/dev/null || fail "This script requires live-build" 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." 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" isofilename="pvc-installer_$(date +%Y-%m-%d).iso"
deployusername="deploy" deployusername="deploy"
@ -168,3 +171,5 @@ fi
echo echo
echo "Build completed. ISO file: ${isofilename}" echo "Build completed. ISO file: ${isofilename}"
popd &>/dev/null

View File

@ -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" 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." 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)/" outputdir="pvc-installer-pxe_$(date +%Y-%m-%d)/"
deployusername="deploy" deployusername="deploy"
@ -79,9 +82,8 @@ fail() {
} }
build_iso() { build_iso() {
idir=$( dirname $0 )
if [[ ! -f pvc-installer_pxe-tmp.iso ]]; then if [[ ! -f pvc-installer_pxe-tmp.iso ]]; then
${idir}/buildiso.sh \ ./buildiso.sh \
-o pvc-installer_pxe-tmp.iso \ -o pvc-installer_pxe-tmp.iso \
-u ${deployusername} \ -u ${deployusername} \
${preserve_artifacts} \ ${preserve_artifacts} \
@ -145,3 +147,5 @@ build_pxe
cleanup cleanup
echo "PVC Live Installer PXE generation complete." echo "PVC Live Installer PXE generation complete."
popd &>/dev/null