Fixes oglivecli to unmount mount points in case of any failure during the oglive installation script
ogboot/pipeline/head This commit looks good
Details
ogboot/pipeline/head This commit looks good
Details
parent
af9c3c33c7
commit
91fd39a9a5
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.8.4] - 2024-06-20
|
||||
### Changed
|
||||
- Corrige oglivecli para que desmonte los puntos de montaje ante cualquier fallo en el script de instalación de oglive
|
||||
|
||||
## [0.8.3] - 2024-06-20
|
||||
### Changed
|
||||
- Añade el cambio de la 0.8.2
|
||||
|
|
|
@ -334,6 +334,20 @@ function install() {
|
|||
[ ! -d "$TMPDIR_SQUASHFS" ] && { echo "{\"error\": \"DIR_CREATION_FAILED\", \"message\": \"Failed to create/access directory $TMPDIR_SQUASHFS.\"}"; exit 500; }
|
||||
|
||||
trap "umount $TMPDIR" 1 2 3 6 9 15
|
||||
|
||||
cleanup() {
|
||||
code=$?
|
||||
umount "$OGLIVEFILE" >/dev/null 2>&1
|
||||
umount "$TMPDIR" >/dev/null 2>&1
|
||||
umount "$TMPDIR_SQUASHFS" >/dev/null 2>&1
|
||||
if [ $code -ne 0 ]; then
|
||||
echo "Something went wrong (exit code $code), cleaning up..."
|
||||
rm -r "$OGLIVEDIR" >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
mount "$OGLIVEFILE" >/dev/null 2>&1 || { echo "{\"error\": \"MOUNT_FAILED\", \"message\": \"Failed to mount ISO file.\"}"; exit 500; }
|
||||
|
||||
cp -va "$TMPDIR/ogclient/"* "$OGLIVEDIR" >/dev/null 2>&1 || { echo "{\"error\": \"COPY_FAILED\", \"message\": \"Cannot copy files to $OGLIVEDIR.\"}"; exit 500; }
|
||||
|
|
Loading…
Reference in New Issue