From 391b9fc70bba9336071cef67bddaa90994ae7e23 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 17 Jan 2026 18:52:41 -0600 Subject: fix(archsetup): add cleanup trap to unmount tmpfs on exit --- archsetup | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/archsetup b/archsetup index c656e25..a44295e 100755 --- a/archsetup +++ b/archsetup @@ -94,6 +94,15 @@ min_disk_space_gb=20 state_dir="/var/lib/archsetup/state" error_messages=() +### Cleanup Trap +# Ensures tmpfs is unmounted if script exits unexpectedly +cleanup() { + if mountpoint -q "$source_dir" 2>/dev/null; then + umount "$source_dir" 2>/dev/null + fi +} +trap cleanup EXIT + ### State Tracking # Enables resuming from where the script left off if interrupted. # State is stored as marker files in $state_dir. -- cgit v1.2.3