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"
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

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"
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