File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -825,6 +825,25 @@ BIN_DIR="\$HOME/.local/bin"
825825DESKTOP_FILE="\$ HOME/.local/share/applications/pairux.desktop"
826826ICON_FILE="\$ HOME/.local/share/icons/hicolor/256x256/apps/pairux.png"
827827
828+ cleanup_stale_appimage_mounts() {
829+ local mount_root="\$ HOME/.pairux/tmp"
830+ [ -d "\$ mount_root" ] || return 0
831+
832+ local mount_dir
833+ for mount_dir in "\$ mount_root"/.mount_PairUX*; do
834+ [ -e "\$ mount_dir" ] || continue
835+
836+ # If the mount is stale ("Transport endpoint is not connected"), unmount
837+ # and remove it so AppImage extract/run can recover on update.
838+ if ! ls -ld "\$ mount_dir" >/dev/null 2>&1; then
839+ fusermount3 -u -z "\$ mount_dir" >/dev/null 2>&1 || \
840+ fusermount -u -z "\$ mount_dir" >/dev/null 2>&1 || \
841+ umount -l "\$ mount_dir" >/dev/null 2>&1 || true
842+ rm -rf "\$ mount_dir" >/dev/null 2>&1 || true
843+ fi
844+ done
845+ }
846+
828847case "\$ {1-}" in
829848 -h|--help)
830849 echo "Usage: pairux [options]"
@@ -923,6 +942,7 @@ case "\${1-}" in
923942 else
924943 echo "Updating PairUX to v\$ LATEST..."
925944 fi
945+ cleanup_stale_appimage_mounts
926946 if command -v curl >/dev/null 2>&1; then
927947 curl -fsSL "\$ INSTALLER_URL/install.sh" | bash
928948 elif command -v wget >/dev/null 2>&1; then
You can’t perform that action at this time.
0 commit comments