[object Object]

← back to Exo

fix: uninstall-exo.sh removes both current and legacy bridge scripts (#1998)

18ffe1df23cd1b9730f3b0e1d7fa49d3ed9cb14b · 2026-04-28 01:28:12 +0100 · Alex Cheema

## Summary

The standalone `app/EXO/uninstall-exo.sh` only knew about the legacy
filename `disable_bridge_enable_dhcp.sh`. On machines installed with
newer EXO versions, the current `/Library/Application
Support/EXO/disable_bridge.sh` was left behind, and the script then
reported `EXO support directory not empty, leaving in place`.

This PR makes the script try both filenames, removing whichever ones
exist. Tolerates **either**, **both**, or **neither** being present
without erroring.

The Swift `NetworkSetupHelper.makeUninstallScript()` already handles
both paths correctly, so the GUI uninstall flow is unaffected — this is
a script-only fix.

Caught while running an end-to-end uninstall on a real machine for
#1997.

## Test plan

Verified the new block in isolation against all four states:

- [x] both `disable_bridge.sh` and `disable_bridge_enable_dhcp.sh`
present → both removed
- [x] only `disable_bridge.sh` present → removed cleanly
- [x] only `disable_bridge_enable_dhcp.sh` present → removed cleanly
(legacy install)
- [x] neither present → prints the existing "already removed?" warning,
exits 0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 18ffe1df23cd1b9730f3b0e1d7fa49d3ed9cb14b
Author: Alex Cheema <41707476+AlexCheema@users.noreply.github.com>
Date:   Tue Apr 28 01:28:12 2026 +0100

    fix: uninstall-exo.sh removes both current and legacy bridge scripts (#1998)
    
    ## Summary
    
    The standalone `app/EXO/uninstall-exo.sh` only knew about the legacy
    filename `disable_bridge_enable_dhcp.sh`. On machines installed with
    newer EXO versions, the current `/Library/Application
    Support/EXO/disable_bridge.sh` was left behind, and the script then
    reported `EXO support directory not empty, leaving in place`.
    
    This PR makes the script try both filenames, removing whichever ones
    exist. Tolerates **either**, **both**, or **neither** being present
    without erroring.
    
    The Swift `NetworkSetupHelper.makeUninstallScript()` already handles
    both paths correctly, so the GUI uninstall flow is unaffected — this is
    a script-only fix.
    
    Caught while running an end-to-end uninstall on a real machine for
    #1997.
    
    ## Test plan
    
    Verified the new block in isolation against all four states:
    
    - [x] both `disable_bridge.sh` and `disable_bridge_enable_dhcp.sh`
    present → both removed
    - [x] only `disable_bridge.sh` present → removed cleanly
    - [x] only `disable_bridge_enable_dhcp.sh` present → removed cleanly
    (legacy install)
    - [x] neither present → prints the existing "already removed?" warning,
    exits 0
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---
 app/EXO/uninstall-exo.sh | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/app/EXO/uninstall-exo.sh b/app/EXO/uninstall-exo.sh
index c51f33a4..d10b9fb3 100755
--- a/app/EXO/uninstall-exo.sh
+++ b/app/EXO/uninstall-exo.sh
@@ -16,7 +16,10 @@
 set -euo pipefail
 
 LABEL="io.exo.networksetup"
-SCRIPT_DEST="/Library/Application Support/EXO/disable_bridge_enable_dhcp.sh"
+# Current script path. Older installs used a different filename; keep the
+# legacy path here so a fresh uninstall still cleans up upgraded machines.
+CURRENT_SCRIPT_DEST="/Library/Application Support/EXO/disable_bridge.sh"
+LEGACY_SCRIPT_DEST="/Library/Application Support/EXO/disable_bridge_enable_dhcp.sh"
 PLIST_DEST="/Library/LaunchDaemons/io.exo.networksetup.plist"
 LOG_OUT="/var/log/${LABEL}.log"
 LOG_ERR="/var/log/${LABEL}.err.log"
@@ -69,11 +72,17 @@ else
   echo_warn "LaunchDaemon plist not found (already removed?)"
 fi
 
-# Remove the script and parent directory
-if [[ -f $SCRIPT_DEST ]]; then
-  rm -f "$SCRIPT_DEST"
-  echo_info "Removed network setup script"
-else
+# Remove the script (current and legacy filenames) — backwards-compatible:
+# tolerate either, both, or neither being present.
+removed_any_script=0
+for script in "$CURRENT_SCRIPT_DEST" "$LEGACY_SCRIPT_DEST"; do
+  if [[ -f $script ]]; then
+    rm -f "$script"
+    echo_info "Removed network setup script: $script"
+    removed_any_script=1
+  fi
+done
+if [[ $removed_any_script -eq 0 ]]; then
   echo_warn "Network setup script not found (already removed?)"
 fi
 

← f0d1371d MLX P/D (#1993)  ·  back to Exo  ·  implement engine abstraction for mlx and mflux (#2000) c80b10c0 →