My-distro-DI-configs/my-distro-debian-32-pae/BldHelper.sh

51 lines
1.5 KiB
Bash
Raw Normal View History

2023-10-29 15:43:55 -01:00
#!/bin/bash
################################################################################
# Title: Bldhelper.sh
# Description: Script to build My-distro ISO image
# Author: manuel rosa <manuelsilvarosa@gmail.com>
# Date: Outubro 29, 2023
# License: GPL-3.0-or-later
################################################################################
# Set environment variables
PREFIX=My-distro-debian
SUFFIX=i386-pae
BUILD=deb-32-pae
FileName="${PREFIX}-${SUFFIX}"
2023-10-29 19:26:55 -01:00
LOCATION=/var/www/html/nightly/my-distro-di/${BUILD}
2023-10-29 15:43:55 -01:00
LogDir=/var/log/Live-Build
2023-10-29 19:26:55 -01:00
WorkingDir=/home/manuel/My-distro-DI-configs/my-distro-debian-32-pae
2023-10-29 15:43:55 -01:00
# Execute the ISO building script
cd ${WorkingDir}
./build.sh
# Move and rename the ISO file
cd build
mv *.iso ${FileName}-${TODAY}.iso
# Create the checksum file for the ISO
sha512sum ${FileName}-${TODAY}.iso > ${FileName}-${TODAY}-sha512.checksum
# Remove old ISO and checksum files from the desired location
rm -f ${LOCATION}/${FileName}*.iso
rm -f ${LOCATION}/${FileName}*-sha512.checksum
# Move the ISO and checksum files to the desired location
mkdir -p ${LOCATION}
mv ${FileName}-${TODAY}.iso ${LOCATION}
mv ${FileName}-${TODAY}-sha512.checksum ${LOCATION}
# Move the log file to the log directory (if it exists)
if [ -f /tmp/${PREFIX}${SUFFIX}.out ]; then
mv /tmp/${PREFIX}${SUFFIX}.out ${LogDir}/${PREFIX}-${SUFFIX}-${BUILD}.log
fi
# Clean the build folder
lb clean
# Remove the "fusato" directory and its contents
cd ..
rm -rf build