diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-17 18:52:41 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-17 18:52:41 -0600 |
| commit | 391b9fc70bba9336071cef67bddaa90994ae7e23 (patch) | |
| tree | 727f1c9a442d76653fee5b348a648302c5411937 /archsetup | |
| parent | c55fa4923af603644fcadeb33138a64f4b9e9bbb (diff) | |
fix(archsetup): add cleanup trap to unmount tmpfs on exit
Diffstat (limited to 'archsetup')
| -rwxr-xr-x | archsetup | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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. |
