diff options
| -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. |
